Richard Lee wrote:
I am trying to open a big file and go through line by line while
limiting the resource on the system.
What is the best way to do it?
Does below read the entire file and store them in memory(not good if
that's the case)..
open(SOURCE, "/tmp/file") || die "not there: $!\n";
while (<SOURCE>) {
## do something
}
sometime ago I saw somewhere it had something like below which look
like it was reading them and going through line by line without
storing them all in memory.
I just cannot remember the syntax exactly.
open(SOURCE, " /tmp/file |") || die "not there: $!\n";
while (<>) {
## do something
}
reposting without php-generals lists.. cc'd them by mistake.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/