in reply to reading file into an array
You could use the Tie::File module.
Some might say it's overkill if all you want is to slurp a file into an array. But the module is great if you want to access the file's lines as though they are in an array, but without the disadvantage of slurping the whole thing into memory at the same time.
Tie::File also allows for in-place editing; if you alter the contents of one of a a tied array's elements, that change is written to the file.
use Tie::File; tie my @array, 'Tie::File', Original or die "Error: $!"; # Do your stuff with @array now.
Enjoy!
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: reading file into an array
by halley (Prior) on Jun 01, 2004 at 17:26 UTC |