in reply to hash iteration with each

I like diotalevi's answer better than this ... but, TIMTOWTDI!
my %hash = ( foo => 1, bar => 2, baz => 3, ); OUTER: for (map{[$_,{%hash}]} qw(this that the_other)) { my ($item,$hash) = @$_; print "$item:\n"; while (my ($key, $value) = each %$hash) { print " $key => $value\n"; if ($item eq 'that' && $key eq 'baz') { print "bailing out!\n"; next OUTER; } } }
The idea is give eash item in the array it's own copy of the hash. This obviously is going to be memory-intensive when scaled up.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)