We don't bite newbies here... much | |
PerlMonks |
Re: mod perl global initializationby Tomte (Priest) |
on May 11, 2004 at 09:00 UTC ( [id://352354]=note: print w/replies, xml ) | Need Help?? |
As the static globals aren't a concern, I'll concentrate on a proposal for your INIT.pl I wouldn't use INIT.pl as global-variables repository. Instead I would define and export a sub in it, that'd assamble the dynamic init-stuff into a hash and return this. Instead of using you had to use or, better yet the Module could look like this (not working code, just a pseudo-perl example out of nothing): Using non-static, not-constant global variables is likely to create a maintenance nightmare; avoid them where possible; using a solution as the proposed isn't much more work, but easily expanded if your needs change. Edit: declared the static hashes, looks betterthat way;-)
regards,
An intellectual is someone whose mind watches itself.
In Section
Seekers of Perl Wisdom
|
|