Dr.Ruud wrote:
Gunnar Hjalmarsson schreef:

     my $content = do { local $/; <$file> };


That idiom uses an extra buffer, as big as the file.
       my $content; { local $/; $content = <file> }

Or:

read( FH, my $content, -s FH ) == -s FH or warn "Could not read the entire file.\n";



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to