Re: Read File Problem

2008-07-29 Thread Dr.Ruud
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

Re: Read File Problem

2008-07-23 Thread Gunnar Hjalmarsson
[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:/

Re: Read File Problem

2008-07-23 Thread Rob Dixon
[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. >

Read File Problem

2008-07-23 Thread andrewmchorney
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