in reply to Help needed in reading a very large file line by line

To read a file line by line, just use
while (<>) { # process the line contained in $_ }
What do you mean by "does not seem to be working"?

Replies are listed 'Best First'.
Re^2: Help needed in reading a very large file line by line
by Anonymous Monk on Feb 28, 2012 at 10:48 UTC
    Opening the big file with the open statement and then using while(<FILEHANDLE>) gives an Out of Memory! error.

      So the file doesn't contain lines?

      It is giving "Out of memory" because in your environment (I suppose it is a UNIX based one) your settings for "ulimit -a" at "data(kbytes)" is less than the file's size; Try modifying the data parameter with a value larger than the file you are processing. If you can't do that, use Tie::File. Slower but not a memory hog user.