Yes, it's because you are using a key that has a newline on it.
Try doing:
my $type = <stdin>; chomp $type;
before using the key.
In reply to Re: printing hash values and keys from user
by liverpole
in thread printing hash values and keys from user
by pinnacle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |