note
gryphon
<p>Greetings [sandrider],</p>
<p>In addition to using labels as two other monks have suggested already, you could use last to exit the inner loop, thus nexting to the outer loop.</p>
<code>foreach my $one (@one) {
$one =~ m/\(.\)(.+)\(.\)/;
foreach my $two (@two) {
if (($1) and ($two eq $1)) {
push @result, $one;
last;
}
}
}
</code>
<p>TMTOWTDI.</p>
<p><b>Update:</b> I moved the m// outside the inner foreach due to [japhy]'s comment. No idea why I didn't see that before. Doh.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-25626">
<p>[gryphon]<br/>
<small>Whitepages.com Development Manager (DSMS)</small><br/>
<i>code('Perl') || die;</i></p>
</div></div>
484035
484035