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

Re: [perl #127386] Setting $! during DESTROY clobbers exit value

Thread Previous | Thread Next
From:
Tony Cook
Date:
January 28, 2016 04:30
Subject:
Re: [perl #127386] Setting $! during DESTROY clobbers exit value
Message ID:
20160128042858.GD31193@mars.tony.develop-help.com
On Wed, Jan 27, 2016 at 11:10:22PM -0500, Felipe Gasper wrote:
> ($? >> 8) is not truthy when $? == 255, so Perl should be exiting 255 … per
> that algorithm.

$? is initially set to 255 by die() using the algorithm you
described, since neither $! nor $? are truthy.

Later on, after the algorithm has set $?, you set $? to 256, and
that's used as the value passed to exit().

Tony

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