in reply to Re: each or keys?
in thread each or keys?
And foreach over (@array) doesn't build a new array, and foreach over (<FILEHANDLE>) doesn't slurp the whole file either. Not really a hack there. That is what foreach is for. Building a quick list to foreach over is cool, but throwing a huge list together in a hurry is hard, and worse, eats scads of memory.
The while loop is much better for large hashes like this case.
--
$you = new YOU;
honk() if $you->love(perl)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (tilly) 3: each or keys?
by tilly (Archbishop) on Oct 11, 2000 at 03:02 UTC | |
by extremely (Priest) on Oct 11, 2000 at 03:52 UTC |