Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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!


Comment on Re: user defined variable as hash key index
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-12-28 02:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (178 votes), past polls