Rob Dixon schreef:
> my $contents = do {
> open my $fh, $source_file or die $!;
> local $/;
> <$fh>;
> };
That has the file's contents in memory twice. This is leaner:
my $contents;
{
open my $fh, $source_file or die $!;
local $/;
$contents = <$fh>;
};
--
Affi
[EMAIL PROTECTED] wrote:
How can I get the read line to read the entire file?
That's a FAQ.
perldoc -q "entire file"
--
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:/
[EMAIL PROTECTED] wrote:
>
> I am trying to read a text file with carriage returns and line feeds on a
> unix system and for some reason it will read only one of text. I use the same
> code in a different perl script and I can read a file that does not have
> carriage returns and line feeds.
>
Hello
I am trying to read a text file with carriage returns and line feeds on a unix
system and for some reason it will read only one of text. I use the same code
in a different perl script and I can read a file that does not have carriage
returns and line feeds.
The existing code is :
open