Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Memory use when reading a text file

by ichimunki (Priest)
on Jul 24, 2002 at 11:51 UTC ( #184785=note: print w/replies, xml ) Need Help??


in reply to Memory use when reading a text file

This is related to your use of for(each), which tries to store the whole file in a temporary array in memory.

Try:

while( my $line = <INP> ){ ... }
instead. This will simply copy each line into memory as needed.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://184785]
help
Chatterbox?
[ww]: Hola, stevieb -- looks lonely around here.
[ww]: Ah, not so much now.
[Your Mother]: Shhhhh, everyone ignore, ww.

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2017-03-30 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (353 votes). Check out past polls.