in reply to Reading binary data
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.
|
|---|