in reply to Re: Read File In Four-Line Chunks / TMTOWTDI / Golf
in thread Read File In Four-Line Chunks / TMTOWTDI / Golf
Instead of slurping everything at once, just read the handle four times. Then you can deal with multi-gigabyte phonebooks.
while (my ($name,$address,$phone,$fax) = (<FILE>, <FILE>, <FILE>, <FIL +E>)) { #work with named vars (don't forget chomp) }
Update: just did a little test, and it does one iteration and stops. Hm.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Read File In Four-Line Chunks / TMTOWTDI / Golf
by Lachesis (Friar) on Jun 10, 2003 at 14:31 UTC |