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

Re: $^E bug and perl 5.8.0

Thread Previous | Thread Next
From:
Chris Nandor
Date:
November 19, 2003 08:07
Subject:
Re: $^E bug and perl 5.8.0
Message ID:
p06010207bbe14513df94@[10.0.1.177]
At 10:59 -0500 2003.11.19, Dan Sugalski wrote:
>On Wed, 19 Nov 2003, Chris Nandor wrote:
>
>> $ perl -le '$^E = -1728; print $^E+0 for 0,1; print $!+0 for 0,1'
>> -1728
>> 22
>> 22
>> 22
>
>Given that on Unix systems $^E and $! are identical, and that $! is
>directly tied to errno, this certainly isn't surprising. Anything that
>afects errno (like, say, IO) may then affect $! and $^E identically.(And
>$!/$^E non-indentically on systems where they're separate)
>
>Basically you're using a variable that can be affected by external things
>in a way that pretty much guarantees that external things will be
>happening. That it changes isn't much of a surprise. ($!/$^E may get
>modified by some signal handlers too, depending on what you do, so there's
>not even any guarantee that "$^E = 42; $^E++;" will end up with $^E set to
>43.

It should not change its value merely by accessing its value.  It's never
done that in previous versions of perl, and shouldn't do it now.

If you're saying that the value of $! changing after $^E changes is not
surprising, yes, I agree.  But the value of $^E changing is very
surprising, and wrong.

-- 
Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

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