On 6/23/06, Jeff Peng <[EMAIL PROTECTED]> wrote:

Hello,
Reading a file which is large as 900M to the array,should consume memory
too
quickly.
Could you open a file and obtain the file-handle in your subroutine,then
return the file-handle to the caller?For example:

sub your_sub{
    ....
    open (FH,$somefile) or die $!;
    return \*FH;
}


Thanks for the reply Jeff, but what I need to do is assign variables based
on the first 5 lines and then push the remaining lines of the file into an
array. Any suggestions?

Maybe I am asking this incorrectly. Here is what I am attempting to do:

-Open one file.
-Read that file.
--Line one will be assigned to $data1
--Line two will be " " to $data2
..
--Line five will be " " to $data5
-- The remaining lines pushed into an array...

Really appreciate any help you can give!

-David

Reply via email to