in reply to how do I get perl to skip lines reading a text file?

Are you looking for readline()?
my $line = <FH>; $line = readline(*FH) if $line =~ /$some_regex/;
Although this is exactly the same as doing <FH> in the given context. Maybe some code would help?
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: next line
by harry34 (Sexton) on May 16, 2002 at 13:17 UTC
    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 ?
      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