$ cat t.pl #!/usr/bin/perl use strict; use warnings; use Data::Dumper; # some data to stick into the hash my $string1 = 'a'; # randomly generated my $string2 = 'f'; # randomly generated my $string3 = 'l'; # randomly generated my $string4 = 'g'; # randomly generated # stick them into the hash my %hashCheckLetter; $hashCheckLetter{$string1}=0; $hashCheckLetter{$string4}=0; $hashCheckLetter{$string3}=0; $hashCheckLetter{$string2}=0; # What does the hash actually have in it? print Dumper(\%hashCheckLetter); # what letters are in the hash? for my $letter ('a' .. 'h') { if (exists $hashCheckLetter{$letter}) { print "Found $letter!\n"; } else { print "Letter $letter not available\n"; } }