print bug

I noticed a bug/"undesirable feature" in activeperl's print.
every time there is a \n activeperl's print prints \r\n
this might be ok for text but it replaces it in binary as well.
I was using a perl script to display a few images as a proxy
and it screws up the images.

use WWW::Mechanize;
my $m = WWW::Mechanize->new();
my $someimage="http://path/to/some/image.jpg";
$m->get($someimage);
my $data = $m->content;
my $contenttype=$m->ct;
print "Content-type: " . $contenttype . "\n\n";
print $data;

If I wanted a \r\n I could easily have added this if I wanted I think
this is a bad idea to be implemented in the print command.
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Jeff Sadowski [ Mi, 25 Juli 2007 18:05 ] [ ID #1778562 ]

RE: print bug

Look up the "binmode" function.


Eric

-----Original Message-----
From: activeperl-bounces [at] listserv.ActiveState.com
[mailto:activeperl-bounces [at] listserv.ActiveState.com] On Behalf Of Jeff
Sadowski
Sent: Wednesday, July 25, 2007 12:06 PM
To: activeperl [at] listserv.ActiveState.com
Subject: print bug

I noticed a bug/"undesirable feature" in activeperl's print.
[...]
If I wanted a \r\n I could easily have added this if I wanted I think
this is a bad idea to be implemented in the print command.
_______________________________________________
_______________________________________________
ActivePerl mailing list
ActivePerl [at] listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
eroode [ Mi, 25 Juli 2007 18:23 ] [ ID #1778563 ]
Perl » gmane.comp.lang.perl.active-perl » print bug

Vorheriges Thema: Arguments for subroutine
Nächstes Thema: running out of memory -- HTML::TreeBuilder