|
|
| Keep It Simple, Stupid | |
| PerlMonks |
how organize code in callback modeby xiaoyafeng (Hermit) |
| on Nov 29, 2011 at 03:43 UTC ( #940516=perlquestion: print w/ replies, xml ) | Need Help?? |
|
xiaoyafeng has asked for the
wisdom of the Perl Monks concerning the following question:
Hi monks Recently, I've been writing a excel template program based on Win32::OLE. for reusing and code elegance, I've used a callback like what File::Find does. Below is sketch of framework: below are some part of codes: Please note $hl in above code, it is a ref from another big object including DBI and Dcom server handles. at this stage, I new it as a global variable and use it in subroutine directly. it make work done but looks ugly. So Is there any good way to re-organize code to make my source more pretty? Do I need to pass the ref of the obj to callback in advance? Thanks in advance!!!! UPDATE: correct codes. I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||