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
Victor Efimov
September 1, 2013 14:37
Re: [perl #119499] $! returned with UTF-8 flag under UTF-8 localesonly under 5.19.2+
Message ID:
2013/9/1 Karl Williamson <>

> And $! remains an outlier in the sense that it is AFAIK, and I've looked
> hard (perhaps not hard enough), now the only place (except for some POSIX::
> routines) where the program's underlying current locale leaks outside the
> scope of 'use locale'.

But that is not the only place, where non-ASCII character can appear.

The following is documented in perlunicode:

"While Perl does have extensive ways to input and output in Unicode, and a
few other "entry points" like the @ARGV array (which can sometimes be
interpreted as
 UTF-8), there are still many places where Unicode (in some encoding or
another) could be given as arguments or received as results, or both, but
it is not."

I believe that note can mean that encoded $! is not a bug, but a feature.
If it's considered a bug, then all other places where non-ASCII appears
encoded, and it's not explicitly documented, can be considered as bug
(examples are $0, %INC values, @INC, something else?)

Thus it's impossible for people to use those variables now, as it may
change anytime in the future.

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