in reply to Re^2: File::Slurp bug? Should I bother?
in thread File::Slurp bug? Should I bother?
Disk size: 21 Inlined, binmode: 21 Slurp, binmode: 21 Inlined, not binmode: 18 Slurp, not binmode: 21 Slurp: 21 Slurp is different from inlined version.
C:\>perl -MFile::Slurp -le "print $File::Slurp::VERSION" 9999.09 C:\>perl -v This is perl, v5.8.6 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail)
Blarg, OK, this may be a problem with sysread.
This gives me the faulty newlines. I think this is a bug in my Perl build. Google turned up some (vague) results to that effect. I assume sysread is supposed to do CRLF translation to \n, just like <>? I checked, and the layers in effect on this filehandle are ("unix", "crlf"). Should be working.use strict; use warnings; use Fcntl qw{:DEFAULT}; use Data::Dump qw{dump}; sysopen my $FILE, 'file', O_RDONLY or die $!; my ($temp, $buf); while(1) { my $read_cnt = sysread ($FILE, $temp, 1024); $buf .= $temp; last unless $read_cnt; } print dump($buf);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: File::Slurp bug? Should I bother?
by ikegami (Patriarch) on Sep 07, 2005 at 18:12 UTC | |
by chester (Hermit) on Sep 07, 2005 at 18:30 UTC |