in reply to don't want to print certain lines

Try the following:
$ver="abc.txt"; open (IN,$ver); $new="new.txt"; open(OUT,"> $new"); while (<IN>){ <IN> and next if /^FIELD/; print OUT; }

This should print to new.txt all lines except any beginning with FIELD and the line immediately following.

Replies are listed 'Best First'.
Re^2: don't want to print certain lines
by dee00zee (Novice) on Oct 27, 2004 at 01:56 UTC
    I try it and it works..thank you.
    But I don't understand this part

    <IN> and next if /^FIELD/;
    print OUT;
    What does <IN> do here and why it didn't print ); that
    appear after FIELD lines:?

      The problem is your first next in your if block, any thing in that block after that next will never be executed.