in reply to open, file handles and memory
Just don't do something like this:
That will definitely clutter up your machine's memory!open(FILE, "somefile") or die $!; my @log = <FILE>; # read entire file into RAM close(FILE); foreach my $line (@log) { # do stuff to $line }
On the other hand, if you have a gigabyte of RAM and you WANT to load the entire file instead of using slow disk accesses, knock yourself out. =)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: open, file handles and memory
by Viking (Beadle) on Jan 13, 2001 at 17:58 UTC |