Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^3: constants wont optimize

by chromatic (Archbishop)
on Jul 11, 2011 at 05:13 UTC ( [id://913654]=note: print w/replies, xml ) Need Help??


in reply to Re^2: constants wont optimize
in thread constants wont optimize

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://913654]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2026-05-10 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.