Setting it side-effects the currently selected file handle. Move it until after the open, or try
Ignore that. I wasn't sufficiently under the influence of caffiene, and got $/ confused with $|.
Try
local $/; is shorthand for local $/ = undef;open FP, "<filename" or die "$filename: $!"; binmode(FP); my $myFile = do { local $/; <FP> }; close FP;
I threw in the binmode in case you're running on Win32.
In reply to Re: Reading binary data
by dws
in thread Reading binary data
by jy38
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |