in reply to Large file problem
Your problem lies in your loop. The Angle operator (i.e. <IN>) works in two contexts: list and scalar. In list context, it returns all the lines of the file as a list; In scalar context, it reads and returns one line at a time.
So:
for (<IN>) { # Do some stuff; }
Reads all the files from IN into an array, then processes them one at a time. You want:
while (<IN>) { # Do some stuff; }
In the above, the angle operator is called in scalar context, so only one file line will be read during each loop iteration. That should (I hope) solve your memory and timing problems.
Update: I see that I type too slowly. ;-)
radiantmatrix
require General::Disclaimer;
s//2fde04abe76c036c9074586c1/; while(m/(.)/g){print substr(' ,JPacehklnorstu',hex($1),1)}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Large file problem
by JohnBrook (Acolyte) on Dec 01, 2004 at 17:42 UTC | |
by ikegami (Patriarch) on Dec 01, 2004 at 18:21 UTC | |
by Anonymous Monk on Dec 02, 2004 at 10:47 UTC |