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

It should be possible straight away by attaching Attribute::Handlers to foo() which sets a flag or even modifies your code...

"it is possible to set up attribute handlers that are called at other points in the program's compilation or execution, by explicitly stating the phase (or phases) in which you wish the attribute handler to be called."

Cheers Rolf

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