if (! @ARGV) { use open ':raw'; # implicit binmode on each open open(ARGV, '-'); } else { use open ':raw'; open(ARGV, shift @ARGV); # Yeah, it's the two-arg version, # because that's what perl does with <> # see perlopentut } # ... now go do all that sysread stuff.