develooper Front page | perl.perl5.porters | Postings from May 2010

Re: [perl #75106] binmode $fh, ":raw" doesn't undo :utf8 on win32

Thread Previous | Thread Next
Leon Timmermans
May 16, 2010 07:12
Re: [perl #75106] binmode $fh, ":raw" doesn't undo :utf8 on win32
Message ID:
On Sun, May 16, 2010 at 3:21 PM, David Golden <> wrote:
> Strangely:
> C:\david\tmp>perl -MPerlIO -wE "binmode STDOUT; say for
> PerlIO::get_layers(STDOUT)"
> unix
> crlf
> But further investigation with get_layers() and detail => 1 reveals
> that crlf just has different flags set depending on whether binmode
> (raw) is called on STDOUT or not.

Yeah, I've also been bitten by this confusing behavior. Unfortunately,
those flags aren't available from Perl, only XS (unless I've missed
something). I've been planning to write a module to query filehandles
for such properties. It would be nice if the core exposed those flags,
it feels like a better place to me.


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