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

[perl #119499] $! returned with UTF-8 flag under UTF-8 locales only under 5.19.2+

Thread Next
Father Chrysostomos via RT
September 21, 2013 03:11
[perl #119499] $! returned with UTF-8 flag under UTF-8 locales only under 5.19.2+
Message ID:
On Mon Sep 16 09:05:17 2013, wrote:
> On 09/09/2013 07:06 PM, Karl Williamson wrote:
> > On 09/02/2013 05:10 PM, Victor Efimov wrote:
> >>
> >> 2013/9/1 Father Chrysostomos via RT <
> >> <>>
> >>
> >>     A new global variable is another option.
> >>
> >> perhaps ${^DECODED_ERROR} ?
> >
> >
> > I have come to believe that this is probably the best way forward.  That
> > is, revert the $! change, and tell people who need it to use the new
> > global variable which will decode as best it can on the given platform
> > based on the locale in effect.
> >
> In looking at this, I thought of something else.  I do believe that the 
> current behavior is correct for such a variable within the lexical scope 
> of "use locale".  But outside such scope the behavior would be to decode 
> fully, as best as practicable on the platform being run on.
> Then it occurred to me would merely changing $! (and $^E) to behave this 
> way address your issues?  It is a change in behavior from the way things 
> have alway been, but outside "use locale", it would fully decode, which 
> someone in the thread was the issue with the current fix.

I was the one who implied that.  What I meant was that, if decoding
happens unconditionally, at least one can check the Perl version to
determine how to handle $!.  It is still backward-incompatible.  I was
then going to suggest lexically scoping the new behaviour, but Zefram
has already pointed out why that is not a good idea.  A new global
variable is the best choice at this point.


Father Chrysostomos

via perlbug:  queue: perl5 status: open

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