|
|
| Think about Loose Coupling | |
| PerlMonks |
Re^3: constants wont optimizeby chromatic (Archbishop) |
| on Jul 11, 2011 at 05:13 UTC ( [id://913654]=note: print w/replies, xml ) | Need Help?? |
|
The fix is to throw another BEGIN around the part that sets the constant. I would like to know why it works. eval is a runtime operation. Sub declaration is a compile time operation. BEGIN does nothing to change that unless you use a BEGIN to perform the runtime eval before the compile time declaration occurs. All of the operations within a single BEGIN block occur, with respect to each other, in the order they would occur if not for the BEGIN block.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||