in reply to Re^2: Modify a line following a target line?
in thread Modify a line following a target line?
The canonical solution is:
my $file = do { local $/; <>; };
But, we're in Perl, so there's more than one way to do it.
$file = join( '', <> );
also works. Of course, you could look at File::Slurp for a CPAN-based solution that's a little more readable.
PS. if you have an open filehandle in $fh, you would replace <> with <$fh> in the above, of course.
|
|---|