in reply to Re: next line
in thread how do I get perl to skip lines reading a text file?

how about if I just wanted to move to the next line regardless of what it contained, would I use the same sort of command ?

Replies are listed 'Best First'.
Re: Re: Re: next line
by broquaint (Abbot) on May 16, 2002 at 13:35 UTC
    Yes you would. When you assign a read from a filehandle in a scalar context the file pointer will be incremented to the next line according to the $/ variable e.g
    while(<FH>) { my $nextline = <FH>; }
    What happens here is that the first line of <FH> is assigned to $_ and the filehandle will point to the second line. When $nextline is assigned the read from <FH> it gets the second line, and the filehandle will then point to the 3rd line, and so on and so forth.
    HTH

    _________
    broquaint