in reply to How can I make a index for log?
$. is the current line number, and tell returns the offset. The array can now be stored using different methods, including Data::Dumper. You could use a hash instead if you wanted to use a key other than the line-number.while (<FH>) { push @index, tell(FH); }
|
|---|