laziness, impatience, and hubris | |
PerlMonks |
Re: Using Global Variables in Perlby samtregar (Abbot) |
on Apr 22, 2008 at 16:57 UTC ( [id://682218]=note: print w/replies, xml ) | Need Help?? |
It's tempting to just tell you not to do that - global variables are generally a poor way to program. But as long as you promise to pick up a copy of Perl Best Practices you can do this in your modules:
openFile("someOtherStuff", $main::readMode); This works because unless your modules declare a package all global variables are in the default "main" package. -sam
In Section
Seekers of Perl Wisdom
|
|