[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Matching the Next Line(s)



At 10:06 AM -0400 5/17/2000, Paul Schinder wrote:
>>Is there a similarly easy way to include the previous two lines?
>
>The easiest way would be to save the previous two lines as you go along.
>If the file is small enough, just slurp the whole thing into an array
>
>@lines = <IN>;
>
>and work on @lines
>
>my $i;
>for ($i = 0;$i < @lines;$i++) {
>	if ($lines[$i] =~ /$string)
>
>etc.
>
>If the file is large, just store the two previous lines somewhere.

I thought as much. I was hoping that you'd show me a clever trick 
that would circumvent this.

Thank you very much for your help--I was heading off on completely 
the wrong tack with regard to getting the next two lines!
-- 
My brain hurts!
SeanC
                      Mediatek Training Institute
            129 Moore Road, Berea, Durban, South Africa
    phone: +27 (0)31 305 4200              SeanC@mediatek.co.za
      fax: +27 (0)31 305 4236
                   <http://members.xoom.com/s_carte>

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org