http://www.perlmonks.org?node_id=779474


in reply to Associative array

It looks to me like you are trying to do two mutually exclusive things at the same time: print multiple values and print just one value. You have used a "for" loop as if you were going to print every value, but then only want to print the "correct" one.

Could it be that the "correct" value is not the first one in the list, and that the first value looked at (not necessarily a "correct" one) is uninitialized?

Blessings,

~Polyglot~