develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [perl #20823] BEGIN { local $@; die 'foo' } doesn't die

Thread Previous | Thread Next
From:
Jos I . Boumans
Date:
March 11, 2003 09:18
Subject:
Re: [perl #20823] BEGIN { local $@; die 'foo' } doesn't die
Message ID:
20030311181818130+0100@nntp.perl.org
In <20030306053337.GA906@ratsnest.hole> Enache Adrian wrote:
>> >> BEGIN { local $@; die 'foo' } seems to bail out of the BEGIN, but 
>> >> doesn't actually die, as if the BEGIN was an eval.

[...]

> Perl_call_list calls itself, by means of S_v?call_list_body
> 	call_sv((SV*)cv, G_EVAL|G_DISCARD);
> 
> and it seems to be no other way to know if that completed correctly
> ( or called die ) that to check if $@/PL_errgv is clear.

maybe an important note, the Carp shipped with 5.6.x and 5.8.0 ALSO use
'local $@' when require'ing Carp::Heavy...

	-Jos

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About