in reply to Can not print hash element

You have not taken the spaces in your input into account. try:
split /\s*,\s*/;
that should fix it.
You were generating a key of " USA", not "USA".


-pete
"Worry is like a rocking chair. It gives you something to do, but it doesn't get you anywhere."

Replies are listed 'Best First'.
Re^2: Can not print hash element
by lightoverhead (Pilgrim) on Sep 23, 2008 at 02:05 UTC
    Thank you very much. You have sharp eyes. It's fixed.
      Another opportunity to promote Data::Dumper =)
      use Data::Dumper; local $Data::Dumper::Useqq = 1; # print non-printable chars print Dumper \%table;

      So, whenever perl seems to be wrong, first debug yourself what data you have.