Q:

how to delete the line after a regex match in Perl

I would like to delete the line after a regex match but I'm unsure how to code for deleting the next line in Perl - help?
while ( my $line = <FILE> ) {
if ($line =~ m/(regex)/i) {
# delete the next $line
}    

A:

What do you mean "delete"?  You mean ignore it?
while ( my $line = <FILE> ) {
    if ( $line =~ /regex/ ) {  # If it matches this regex
        my $ignored = <FILE>;  # read the next line and ignore it.
    }
}

