At 7:03 PM -0400 4/30/2002, Kenneth Graves wrote:

>If you are determined to do it in Perl, then slurp all of the
>lines into an array and print @array[$i-N .. $i+M].

If your file is HUGE you may not want to do this.  Instead, keep
a rotating buffer array of N+M+1 lines.  With each new line,
you discard the least recently read one.

--
Ron Newman      [EMAIL PROTECTED]
http://www2.thecia.net/users/rnewman/


Reply via email to