chomp( my @array = <FILE> ); foreach my $previous_line_no ( 0 .. $#array ) { # count through the ar +ray. # runs over its bounda +ry, hmm. # see with warnings on +. my $line_no = $previous_line_no + 1; if ( $array[$line_no] =~ m/fail/ ) { splice( @array, $previous_line_no, 1 ); # take that previous l +ine out. } }
Cheers, Sören
In reply to Re: Parsing text file question
by Happy-the-monk
in thread Parsing text file question
by sashac88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |