On Sun Mar 21 08:57:59 2004, CORION wrote:
Show quoted text> [guest - Tue Mar 16 14:31:00 2004]:
>
> > why is BINMODE not on by default? (why is it a nullop)
>
> Here is a test case that demonstrates the problem for Win32:
>
> #!/usr/bin/perl -w
> use strict;
> use File::Temp qw(tempfile);
> use Test::More tests => 2;
>
> use_ok( 'IO::All' );
>
> my ($fh,$filename) = tempfile();
>
> my $binary = "foo\r\nbar";
> binmode $fh;
> print $fh $binary;
> close $fh;
>
> my $content = io($filename)->slurp;
> is($binary, $content);
This is because that's how perl works. For the vast majority of the time \r\n and \n are interchangeable. If you *do* want to care, you can turn on binary yourself.