in reply to Re^2: binmode and sysread on <>
in thread binmode and sysread on <>
In your first snippet, you've reversed what needs to happen.
if (@ARGV) { # something's in @ARGV so we'll use it use open ':raw'; # implicit binmode on each open open(ARGV, shift @ARGV); # Yeah, it's the two-arg version, # because that's what perl does with <> # see perlopentut } else { # nothing's in @ARGV so we'll use STDIN use open ':raw'; # implicit binmode on each open open(ARGV, '-'); } # ... now go do all that sysread stuff.
|
|---|