in reply to Fastest I/O possible?
This should read up to 100k chunks at a time but also making sure the chunk ends on a new line. As far as I'm aware there are no buffering modules like you describe (at least a quick CPAN search doesn't seem to turn anything up) so perhaps it's time to write one?{ # NOTE: code is untested my @chunks = (); local $/ = \102400; while(<$fh>) { my $chunk = $_; my $last_rs = rindex($chunk, $/) push @chunks, substr($chunk, 0, $last_rs); seek($fh, 1, -(length($chunk) - $last_rs)); } }
_________
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Fastest I/O possible?
by sauoq (Abbot) on Aug 23, 2002 at 01:47 UTC |