in reply to user defined variable as hash key index
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 :-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: user defined variable as hash key index
by pleasehelp (Initiate) on Oct 15, 2007 at 21:54 UTC |