Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: user defined variable as hash key index

by naikonta (Curate)
on Oct 16, 2007 at 01:12 UTC ( #645087=note: print w/replies, xml ) Need Help??

in reply to user defined variable as hash key index

Additionally from FunkyMonk's answer, you may also want to put some checking to see if supplied name doesn't exist in %numbers to avoid unitialized warning.
print "Who's number are you looking for? : \n"; chomp(my $who = <STDIN>); my $number = $numbers{$who} || 'unknown'; print "$who number is $number\n";

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://645087]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2016-10-25 10:36 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (316 votes). Check out past polls.