in reply to Using ":raw" layer in open() vs. calling binmode()
Looks like a bug to me, since the behaviour appears to contradict the description in the docs (either a doc bug or a code bug).$ perl --version This is perl, v5.8.8 built for i486-linux-gnu-thread-multi ... $ perl -MPerlIO -e 'open($fh, "<", "/dev/null"); print join(", ", PerlIO::get_layers($fh)), "\n";' unix, perlio $ perl -MPerlIO -e 'open($fh, "<:raw", "/dev/null"); print join(", ", PerlIO::get_layers($fh)), "\n";' unix $ perl -MPerlIO -e 'open($fh, "<", "/dev/null"); binmode $fh; print join(", ", PerlIO::get_layers($fh)), "\n";' unix, perlio
For what it's worth, I tend to use the binmode $fh; variant, but that's a habit formed in pre-layer times.
|
|---|