in reply to diamond operator, inplace edit and io layers

Why is the input layer not converting 0x0d0a to 0x0a?

It is for me

$ perl -e" binmode STDOUT; $|=1; print qq[\x0d\x0a]; " | od -tx1 0000000 0d 0a 0000002 $ perl -e" binmode STDOUT; $|=1; print qq[\x0d\x0a]; " | perl -e" use +open qw/ IN :crlf OUT :raw /; print join q/ /, unpack q/H*/, scalar<> +; " 0a $ perl -e " die $] 5.014001 at -e line 1.

See also Why Doesn't Text::CSV_XS Print Valid UTF-8 Text When Used With the open Pragma? / #92728: pragma open handles STDERR improperly

Replies are listed 'Best First'.
Re^2: diamond operator, inplace edit and io layers
by Dirk80 (Pilgrim) on Jul 03, 2012 at 19:49 UTC

    The difference is that you are not doing inplace editing.

    UPDATE

    I now tried your examples. And partly I have different results:

    Same result like you.

    $ perl -e" binmode STDOUT; $|=1; print qq[\x0d\x0a]; " | od -tx1 0000000 0d 0a 0000002

    Different result.

    $ perl -e" binmode STDOUT; $|=1; print qq[\x0d\x0a]; " | perl -e" use +open qw/ IN :crlf OUT :raw /; print join q/ /, unpack q/H*/, scalar<> +; " 0d0a

    Here my perl version.

    $ perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for i686-linu +x-gnu-thread-multi-64int