The solution: redefine $/ right after your slurp:No. That's just another potential problem. The solution is:
Or:my $slurp; {local $/; $slurp = <INPUTFILE>};
Or even:my $slurp = do {local(@ARGV, $/) = "inputfile"; <>};
my $slurp = `cat inputfile`;
In reply to Re: Common Perl Pitfalls
by JavaFan
in thread Common Perl Pitfalls
by Joe_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |