How about using redo and a c-style for loop?
my (@array, $i); @array = <FILE>; for ($i = 0; $i <= $#array; $i++) { if ($i > 0 and $array[$i] =~ /\bfail\b/) { splice @array, $i - 1, 1; redo; } }
--
integral, resident of freenode's #perl
In reply to Re^2: Parsing text file question
by integral
in thread Parsing text file question
by sashac88
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |