A common Perl idiom for this is (the change to $/ is localized to the do block):
There is even a module: File::Slurp.my $filename = 'file.name'; open my $fh '<', $filename or die "opening $filename: $!"; my $contents = do { local $/; <$fh> };
In reply to Re: undef $/ to null
by AnomalousMonk
in thread undef $/ to null
by Selvakumar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |