in reply to Fast way to read from file
Fast-read (repeatedly called)my $curpos = 0; my @offset; $offset[0] = 0; # 1st line always start at pos 0 while (<$fh>) { $offset[++$curpos] = tell $fh; }
seek $fh, $offset[$cur], 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Fast way to read from file
by Hena (Friar) on Nov 21, 2003 at 12:22 UTC | |
by Roger (Parson) on Nov 21, 2003 at 12:49 UTC | |
by broquaint (Abbot) on Nov 21, 2003 at 14:53 UTC | |
by l3nz (Friar) on Nov 21, 2003 at 13:42 UTC | |
|
Re: Re: Fast way to read from file
by bschmer (Friar) on Nov 21, 2003 at 12:34 UTC |