develooper Front page | perl.perl5.porters | Postings from October 2011

Re: [perl #100496] the -p flag ignores PERLIO and seems entirely unchangeable

Thread Previous | Thread Next
From:
Eric Brine
Date:
October 2, 2011 21:37
Subject:
Re: [perl #100496] the -p flag ignores PERLIO and seems entirely unchangeable
Message ID:
CALJW-qGdJKqF-n8P+nEEQw-g5=EBj69N728W0XjrqJX_Zfu=xg@mail.gmail.com
On Sun, Oct 2, 2011 at 6:24 PM, Leon Timmermans <fawaka@gmail.com> wrote:

> On Sun, Oct 2, 2011 at 9:08 PM, Eric Brine <ikegami@adaelis.com> wrote:
> > So the problem is that PERLIO doesn't affect STDOUT. There may be similar
> > issues regarding ARGV and STDIN.
>
> No, it does affect STDOUT and friends, it just does the wrong thing:
> it knocks out the buffering layer


raw has long done more than it's documented as doing. The following didn't
work before 5.14 because raw would pop the scalar var handler:

perl -wE"{ open my $fh, '>:raw', \$_ or die $!; say $fh 'foo' } print;"

I guess the fix wasn't complete.

 (which on windows moonlights as crlf
>
 layer). Check the output of «PERLIO=raw perl -E 'say STDERR join "\n",
> PerlIO::get_layers(\*STDOUT)'»


On Windows, that shows the :crlf gone.

Thanks for helping me refine the problem.

- Eric


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