Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: How do I know if I'm in a BEGIN block?

by kyle (Abbot)
on Oct 29, 2009 at 03:35 UTC ( #803868=note: print w/ replies, xml ) Need Help??


in reply to How do I know if I'm in a BEGIN block?

See perlmod.

BEGIN { $I_AM_COMPILING = 1 } INIT { $I_AM_COMPILING = 0 } sub foo { if ( ! $I_AM_COMPILING ) { } }

I don't know if that will work, but that's what I'd try first.


Comment on Re: How do I know if I'm in a BEGIN block?
Download Code
Re^2: How do I know if I'm in a BEGIN block?
by dgaramond2 (Monk) on Oct 29, 2009 at 13:59 UTC
    Thanks! I feel so stupid for not having come up with that myself :-(

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2014-09-02 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (22 votes), past polls