http://qs321.pair.com?node_id=964222


in reply to Common Perl Pitfalls

The solution: redefine $/ right after your slurp:
No. That's just another potential problem. The solution is:
my $slurp; {local $/; $slurp = <INPUTFILE>};
Or:
my $slurp = do {local(@ARGV, $/) = "inputfile"; <>};
Or even:
my $slurp = `cat inputfile`;