Dr.Ruud wrote:
Gunnar Hjalmarsson schreef:
Dr.Ruud:
Gunnar Hjalmarsson:

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

That idiom uses an extra buffer, as big as the file.

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

Does it? In that case, why is it mentioned at
http://faq.perl.org/perlfaq5.html#How_can_I_read_in_an

Because it looks and reads nice? But probably you mean I should have
submitted a bug report.

No, I rather got defensive... Actually, I find it annoying that an idiom suggested in the FAQ has such a drawback, especially when it can easily be avoided.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

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


Reply via email to