develooper Front page | perl.perl5.porters | Postings from August 2012

[perl #44367] goto LABEL doesn't work from within $SIG{__DIE__}

Thread Previous
Father Chrysostomos via RT
August 13, 2012 09:57
[perl #44367] goto LABEL doesn't work from within $SIG{__DIE__}
Message ID:
On Mon Aug 13 02:03:27 2012, wrote:
> On 07/03/2012 10:27 PM, Father Chrysostomos via RT wrote:
> > On Tue Jul 03 13:17:46 2012, doy wrote:
> >> So have we decided this is a wontfix then?
> >
> > I haven’t. :-)
> >
> > I still think it a wart from the point of view of the Perl language
> > (rather than the implementation) that goto works to exit subroutines and
> > evals, but not sort blocks, tie/overload methods, eval 'BEGIN
{...}', etc.
> >
> > I would still like to fix this.
> I won't stop you, but *please* don't fix this at the cost of 
> performance. My gut feeling is that this is because of some obscure 
> optimization such as "sort blocks do multicall" that makes a very big 
> difference in practice.

The reason it cannot exit a sort block is that sort is a single op that
starts a new runloop each time it calls the block (as opposed to map and
s/// which consist of multiple ops and use the main runloop).

The only overhead would be an extra setjmp for each runloop, which I
think would be negligible enough not to be reliably measurable.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

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