in reply to Reading binary data

There's a sublety to the use of $/;

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

open FP, "<filename" or die "$filename: $!"; binmode(FP); my $myFile = do { local $/; <FP> }; close FP;
local $/; is shorthand for local $/ = undef;

I threw in the binmode in case you're running on Win32.