You need to chomp your input to get rid of the newline:
print "Who's number are you looking for? : \n"; my $who = <STDIN>; chomp $who; print "$who number is $numbers{$who}\n";
Code look much better if you wrap it in <code> ... </code> tags :-)
In reply to Re: user defined variable as hash key index
by FunkyMonk
in thread user defined variable as hash key index
by pleasehelp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |