Do you know where your variables are? | |
PerlMonks |
Re: conditional enable use bytes for a whole module at compiletime?by Random_Walk (Prior) |
on Nov 19, 2004 at 13:33 UTC ( [id://408989]=note: print w/replies, xml ) | Need Help?? |
I think you will find there is an issue here with use and BEGIN. use is equivalent to BEGIN { require Module; import Module LIST; } and a BEGIN block is run as soon as possible. This effectively means when the closing brace is encountered. In your above code the implied BEGIN block in use will be run before the surrounding BEGIN block and its if logic is evaluated. Not What you want. I read a node recently that explained it all far better than I can, I will link it here as soon as I can find it Here tachyon gives an ellegant eaxample of the futility of wrapping use in an if </code>Cheers,
In Section
Seekers of Perl Wisdom
|
|