use strict; # or die use warnings; # or die my %hash = ( cogito => "ergo sum" # I think, so I exist ); if (exists $hash{absum}) { print "Absum exists."; } else { print "Absum doesn't exist.\n"; # which would explain it's name... } print "Keys in the hash: ", join(" :: ", keys %hash), "\n"; __END__ Absum doesn't exist. Keys in the hash: cogito #### use strict; use warnings; my %hash = ( list1 => ["foo", "bar", "baz"] ); print "list1: [- ", join(" :: ", @{ $hash{list1} || []}), " -]\n"; print "list2: [- ", join(" :: ", @{ $hash{list2} || []}), " -]\n"; __END__ list1: [- foo :: bar :: baz -] list2: [- -]