# USING PREDECLARATIONS IT FAILS my $x=""; my $another=""; print "WITH PREDECLS\n"; $x->{"FISH2"} = "FISH2"; $another->{"NONE"}="NONE"; foreach $item (keys %{$x}) { print "ELEMENTS: $item, $x->{$item}\n"; } # NOT USING PREDECLARATIONS IT WORKS print "\n\nWITHOUT PREDECLS\n"; $x2->{"FISH2"} = "FISH2"; $another2->{"NONE"}="NONE"; foreach $item (keys %{$x2}) { print "ELEMENTS: $item, $x2->{$item}\n"; }