http://qs321.pair.com?node_id=803868


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.