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:
Victor Efimov
Date:
September 1, 2013 18:08
Subject:
Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+
Message ID:
CAF7QZD4F1tn4qFn01qHtLSm=RPv-jK03TQkH_73QsXS7cSBuNw@mail.gmail.com
one problem with lexical scope is also POSIX::strerror.
currently it's implemented using

strerror  => 'errno => local $! = $_[0]; "$!"',

thus it has to be fixed too if we implement lexical featurization.


2013/9/1 Zefram <zefram@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