in reply to Re: Re: Re: Re: RFC : Pragma vs. Module
in thread RFC : Pragma vs. Module

BEGIN and END work in eval "". It's just CHECK and INIT that have to be set up before the compile of the main script ends or they are "too late".
  • Comment on Re: Re: Re: Re: Re: RFC : Pragma vs. Module

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: RFC : Pragma vs. Module
by theorbtwo (Prior) on Mar 15, 2004 at 09:42 UTC

    By the way, it looks like perl 5.9.1 (and thus the eventual 5.10.0) will get a UNITCHECK that is defined to run at the end of compliation of that "compilation unit" (string eval, do file, require). That should fix the problem.

      I think that won't be in 5.9.1. It's mentioned in the perl591delta just in the todo-for-5.10 list, and 5.9.1 should be "released" any time now.

      The feature needs more discussion, anyway. As is, it doesn't sound like it would work for a module that wants something to run when the thing using it is done compiling.