foreach my $key (keys %hash){ print "$key => $hash{$key}\n"; } # or shorter: foreach (keys %hash){ print "$_ => $hash{$_}\n"; }