in reply to some forking help

Thanks for your input, I thought that I'd be able to save some time with running over 50 (turns out to be 93)process against a 100 Mb file (just under a million lines).
But you guys think the precompiled regex and a loop is a better solution so I'll go that way. 'dmmiller2k' likes how simple it is and so do I.
now,... is it better to load the file into an array (@ARGV = qw(file.txt);) or to just go through it line by line
(while FILENAME) {blah blah blah}?
Thanks again
John

Replies are listed 'Best First'.
Re: Re: some forking help
by chromatic (Archbishop) on Dec 25, 2001 at 01:42 UTC
    You'll eat up a lot of memory by reading the file into an array, and there'll be a hit for the initial read. Going line by line is a little gentler, though it's hard to say if the memory re-use will perform better. If you run out of swap space, you'll definitely have trouble. I nearly always use while.