perlquestion
Anonymous Monk
<p>This is greatly simplified - I hope it makes sense. :)<p>
<p>I am trying to loop over rows of an array doing a test. If the test fails, I want to go all the way back to the outer loop, which the documentation suggests will work only with foreach.<p>
<code>
#!/usr/bin/perl -w
use strict;
my @x =
(
['aaaaa', 'bbbbb', 'ccccc', 'ddddd',],
['eeeee', 'fffff', 'ggggg', 'hhhhh',],
['iiiii', 'jjjjj', 'kkkkk', 'lllll',],
);
for my $i (1 .. 1000)
{
for my $a (@x)
{
my $ifails = 0;
for my $j (0 .. (scalar @$a) - 1 )
{
<get external data string for pattern matching here, put in $c>
if ($c =~ /$a->[$j]/) { $ifails++; }
}
if ($ifails > 1) { want to go to outer loop here, and not process the next (and subsequent) row(s) }
}
}
</code>
<p>Is there some way of doing that? Note that in the actual application, I do have more more processing below the inner loop, so a "last" statement at the test doesn't work.<p>
<p>Thank you in advance.<p>
5