Pat Rice wrote:
Hi all

Hello,

I am looking at a way of reading a line doing a regex to find the
specific line then pick out the line, sudo code would be some thing
like the following:

read in line
check regex

if regex is correct
{    jump 10 lines
    print the output
}

any ideas on jumping the 10 lines, how do I ignore the lines in the
file, and know I'm going the right distance ?

Here is another way to do it:

my $jump;
while ( <FILE> ) {
    $jump = $. + 10 if /regex/;
    print "the output" if $jump == $.;
    }


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to