in reply to Parsing a 4M+ Contiguous text file

Try using seek() on your file handler to read certain amount of data from the spot where you last stopped parsing this file. My understanding is that this should eliminate your "Out of Memory" problem and allow for greater control.
# $fh is your file handler seek($fh, $old_position, 0); my $buffer = read($fh, 200000); # read ~200KB from the file # save current position $old_position = tell($fh); # do whatever you want with the buffer # here..
cheers

"There is no system but GNU, and Linux is one of its kernels." -- Confession of Faith

Replies are listed 'Best First'.
Re: Re: Parsing a 4M+ Contiguous text file
by chip (Curate) on Dec 19, 2001 at 12:23 UTC
    Perl's read() takes at least three parameters, a la:   read($fh, $buffer, 200000)

        -- Chip Salzenberg, Free-Floating Agent of Chaos