my %hash = (foo => 42, bar => 84); # Here is the easiest way: my @kv_pairs = %hash print "All keys and all values as a flattened list: ", @kv_pairs, "\n"; # Ok, an even easier way: print "All keys and all values as a flattened list: ", %hash, "\n"; # Because, list context. # Here is another way: while (my ($key, $value) = each %hash) { print "$key => $value\n"; } # Here is another way: my @keys = keys %hash; my @values = values %hash; for my $i (0.. $#keys) { # (fixed) print "$keys[$i] => $values[$i]\n"; } # And yet another: foreach my $key (keys %hash) { print "$key => $hash{$key}\n"; }