in reply to Re^5: Error binmode() on unopened filehandle
in thread Error binmode() on unopened filehandle
My last example was without the special DATA file handle and shows that my $binary = <$fh> will read the data from $fh up to and including the first appearance of $/. Using binmode on a file handle does not change this behaviour.
You may check if:
EDIT: Here is another:
#!/usr/bin/perl use strict; use warnings; use constant RANDFILE => "rand.dat"; system "dd if=/dev/urandom of=" . RANDFILE . " bs=1k count=64"; open my $fh, '<', RANDFILE or die; binmode $fh; my $binary = <$fh>; print "got: ", length($binary), "\n";
Greetings,
-jo
|
|---|