develooper Front page | perl.perl5.porters | Postings from September 2013

Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+

Thread Previous | Thread Next
From:
Zefram
Date:
September 1, 2013 17:45
Subject:
Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+
Message ID:
20130901174537.GJ31643@fysh.org
Karl Williamson wrote:
>Within its scope Perl attempts to decode $! as best it can,

Scoping doesn't work well for this sort of thing.  The decoding happens in
get magic, when the variable is being read.  If that behaviour is affected
by the lexical scope in which the reading happens, this means that
different readers will see different values in the same variable, which
is awfully confusing if a reference to the variable gets passed around.
Worse, XS code gets the behaviour of *its caller's* lexical scope.

Amusingly, $[ used to influence $#foo magic variables in this manner.
It's one of the reasons I'm glad we got rid of $[.

-zefram

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