Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-All CPAN distribution.

Report information
The Basics
Id: 5686
Status: rejected
Priority: 0/
Queue: IO-All

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: why is BINMODE not on by default? (why is it a nullop)
why is BINMODE not on by default? (why is it a nullop)
Download (untitled) / with headers
text/plain 430b
[guest - Tue Mar 16 14:31:00 2004]: Show quoted text
> 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);
Download (untitled) / with headers
text/plain 685b
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.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.