if($dog_hash{$dog_type}){ print "dog [$dog_type] already in hash\n"; }else{ $dog_hash{$dog_type} = $food_type; }