I have a for loop nested within a hash loop. If the push to @groups is performed I want the for loop to exit and the hash loop to move onto the next key. I think I should be using next, but where to put it?
while ( my ($key, $value) = each %ids ) { for my $item (@names) { if ($item =~ /$key/) { push @groups, $item; } } }
In reply to nested loops and next by jonnyfolk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |