in reply to Slurp a file
Oops. You've just left $/ set to undef for the rest of the program. This can lead to all sorts of nastiness.
Better to do something like this:
my $file_text; { local $/; $file_text = <FILE>; } print $file_text;
Which returns $/ to its original value once you leave the bare block.
Update: I should point out that my correction was to the original version of this node. It's now been changed to use my suggestion.
--<http://www.dave.org.uk>
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In Section
Cool Uses for Perl