use strict;

my %pairs = ( "hello" => 13,
	      "world" => 31,
	      "!" => 71 );









while ( my ($k, $v) = each %pairs) {
    print "(k,v) = ($k, $v)\n";
}


foreach my $key ( keys %pairs ) {
    print "key = $key, value = $pairs{$key}\n";
}

while ( my $key = each %pairs) {
    print "key = $key, value = $pairs{$key}\n";
}


foreach my $val ( values %pairs ) {
    print "value = $val\n";
}