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

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

Thread Previous
From:
Leon Timmermans
Date:
February 4, 2012 06:56
Subject:
Re: [perl #100496] the -p flag ignores PERLIO and seems entirely unchangeable
Message ID:
CAHhgV8hx8RKo6Cq_xqo6aC7BDMk757JkvVrDSJEAhLpiq9_9Ew@mail.gmail.com
On Mon, Oct 3, 2011 at 1:04 AM, Craig A. Berry <craig.a.berry@gmail.com> wrote:
> Yes, that looks like exactly what it's doing:
>
> 1191         if (s) {
> 1192             PerlIO_parse_layers(aTHX_ PL_def_layerlist, s);
> 1193         }
> 1194         else {
> 1195             PerlIO_default_buffer(aTHX_ PL_def_layerlist);
> 1196         }
>
> from
>
> http://perl5.git.perl.org/perl.git/blob/HEAD:/perlio.c#l1191
>
> where s is the string containing what PERLIO translated to.

When PerlIO is initialized, the standard in/out/err are all explicitly
opened as textstreams. It seems that, lacking the crlf layer because
of :raw the newline translation is actually done natively; this is
rather surprising because it's kind of hard to trigger this edge case,
I'm not even sure why we'd want this to be possible in the first
place.

Leon

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