# food color per the introduction foreach $name ("Banana", "Martini") { if(exists($food_color{$name})) { # it exists print "$name is a food. \n"; } else { # it doesn't print "$name is a drink.\n"; } }