Have a look in the perlmod-manpage to learn about BEGIN, UNITCHECK, CHECK, INIT and END and when they are run.
But in my opinion you should not configure your program with global variables.
There are so many problems with this approach that I don't even know where to start...
My approach would be to have a configuration object that is a singleton (a posher version of a global variable :-) and that can either be initialized in main or in a "lazy" way when it is needed.
In reply to Re: BEGIN vs initialization
by morgon
in thread BEGIN vs initialization
by Wiggins
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |