develooper Front page | perl.perl5.porters | Postings from January 2001

Re: Too late to run CHECK block.

Thread Previous
Gurusamy Sarathy
January 29, 2001 08:50
Re: Too late to run CHECK block.
Message ID:
On 29 Jan 2001 16:27:12 GMT, Piers Cawley wrote:
>Gurusamy Sarathy <> writes:
>> In the current implementation, there is exactly one point at which
>> CHECK and INIT blocks are run (this being the point at which the
>> Compiler would do its work, when it saves and restores program
>> state, respectively).
>> But I believe Larry has stated that CHECK blocks should be able to
>> run at the end of compilation of every individual "compilation unit",
>> whatever that happens to be (file/BEGIN block/eval"").  Will those
>> semantics be useful for you?
>That would definitely be handy to have. It's certainly the behaviour I

It's not clear then how the Compiler should do the checkpointing,
given that it needs to do its thing from a module.  It would seem
to need a mechanism to postpone CHECK block execution to the end
of compilation of the main script (as opposed to the end of
compilation of the current unit).

Alternatively, there may be value in adding attributes:

    CHECK :local {...}
    INIT :local {...}

Or maybe run with the current semantics when they do:

    CHECK :global {...}
    INIT :global {...}

(but that has a compatibility issue).


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About