my $ht = \%h1; while ( my ( $key, $value ) = each(%$ht) ) { ... }