Since you seem to want to put the contents of the file into array and are experiencing memory issues, you may want to check out Tie::File. From its description:
The file is not loaded into memory, so this will work even for gigantic files.
Also, you can check out the memory section of its documentation for information on controlling part of the memory usage for Tie::File.
Tie::File might not be the best solution for you, but it's the first thing that popped into my mind when reading your question.
In reply to Re: memory use array vs ref to array
by dasgar
in thread memory use array vs ref to array
by dkhosla1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |