use warnings; use strict; my %c = ( hey=>'Joe', where=>'you goin\'', with=>'that gun in your hand'); if (defined $c{Hendrix}) { print "Jimi is alive and well\n"; } foreach ( sort keys %c ) { print "Key : $_ => $c{$_}\n"; }