my $n = keys %$h; for ( my $i = 0; $i < $n; $i++ ) { local( $a, $b ) = each %$h; $c->() }