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

[perl #114094] use open pragma overrides std

Thread Previous
From:
James E Keenan via RT
Date:
September 16, 2012 19:11
Subject:
[perl #114094] use open pragma overrides std
Message ID:
rt-3.6.HEAD-11172-1347847896-949.114094-15-0@perl.org
On Tue Sep 11 21:20:31 2012, thewebsi wrote:
> On Wed Jul 11 15:27:19 2012, thewebsi wrote:
> > generated with the help of perlbug 1.36 running under perl 5.10.0.
> 
> This appears to be a duplicate of
> https://rt.perl.org/rt3/Public/Bug/Display.html?id=92728, which is
> marked Resolved in 5.12.3, but I'm getting the same bad results under
> perl 5.14.2:
> 
> #!/usr/bin/perl
> 
> use open ( ":encoding(UTF-8)", ":std" );
> use open ( ":encoding(UTF-8)" );
> 
> print "DEBUG: STDOUT=" . join ( ",", PerlIO::get_layers ( STDOUT ) ) .
"\n";
> 
> Result:
> DEBUG: STDOUT=unix,perlio

I am getting what you describe as a bad result by running your program
with Perl 5.14.0:

##########
$ cat 114094_encoding.pl 
#!/usr/bin/perl

use open ( ":encoding(UTF-8)", ":std" );
use open ( ":encoding(UTF-8)" );

print "DEBUG: STDOUT=" . join ( ",", PerlIO::get_layers ( STDOUT ) ) . "\n";

$ /usr/local/bin/perl5.14.0 114094_encoding.pl 
DEBUG: STDOUT=unix,perlio
#########

However, when I run this with Perl 5.16.0, I get the results you want:

#########
$  /usr/local/bin/perl5.16.0 114094_encoding.pl 
DEBUG: STDOUT=unix,perlio,encoding(utf-8-strict),utf8
#########

So I believe the problem has indeed been corrected.

Thank you very much.
Jim Keenan




---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=114094

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About