Normally the input record separator should only be changed in the scope for which you need to change it
in reply to Re^2: Perl ignores CarriageReturn during fileparsing. Why?
in thread Perl ignores CarriageReturn during fileparsing. Why?
# code "borrowed" from node 1952 :-)
local $/ = undef;
open FILE, "myfile" or die "Couldn't open file: $!";
$string = <FILE>;
# $/ reverts back to default here...
If you spot any bugs in my solutions, it's because I've deliberately left them in as an exercise for the reader! :-)