in reply to RE: grabbing N lines after matching one?
in thread grabbing N lines after matching one?

the main problem i see with this code is the following: push @lines; this line does nothing, so the @lines array is always empty whe you attempt to print its contents. what you probably wanted is: push @lines, $_; also, you are testing the equality of a numeric variable against an integer with eq which is the string equality operator, as opposed to == the numeric one.

Replies are listed 'Best First'.
RE: RE: RE: grabbing N lines after matching one?
by jptxs (Curate) on Sep 16, 2000 at 21:07 UTC

    bingo :) ...and just the other day my pal was chiding me for not using the default actions enough. I guess I too overzelous with them this time, I thought 'push' would just shove $_ in there lacking any other arguement. RTFM on me :)

    -- I'm a solipsist, and so is everyone else. (think about it)