in reply to How can I process large files with while(<>)?
open( HANDLE, "list.txt" ) or die "Cannot open file - $!"; while( <HANDLE> ) { # Process file line by line here } close HANDLE;
The while(<>) structure iterates through the magic ARGV handle, line by line, where each line is defined as ending by the input record separator, $/. In the example above, the filehandle, HANDLE is specified to be iterated through in this manner thereby performing the task of reading through a large file without storing it all in an array first.
perl -e 'print+unpack("N",pack("B32","00000000000000000000000111100011")),"\n"'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How can I process large files with while(<>)?
by Ritter (Sexton) on Nov 17, 2002 at 10:09 UTC |