Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 studying the Monastery: (8)
As of 2015-07-03 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (54 votes), past polls