Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Comparing Hash's key to an <STDIN> and print it's corresponding value

by xxArwaxx (Novice)
on Apr 07, 2011 at 13:32 UTC ( [id://898056]=note: print w/replies, xml ) Need Help??


in reply to Re: Comparing Hash's key to an <STDIN> and print it's corresponding value
in thread Comparing Hash's key to an <STDIN> and print it's corresponding value

wow! for a first reply, it's pretty much impressive how much I'm benefiting from these brain storming, in both, Perl and grammatical sense! :P well, I was like "what if the person is he, then what if he is a she" then I thought of replacing it with an "it" for time saving purposes as my main concern was actually running the code! lol I totally agree with what you just mentioned, because I've been in the situation of printing the number of elements there and not only once but in the same number as key-value pairs was there! after fixing it, I can understand the context concept you're talking about! I understood it even more, from the latter example you proposed! loved how you made use of arrays to print the index of the key that has been entered by the user, and then printing it's value! what's interesting even more in your code and might need a bit of elaboration, if you don't mind me, is that part when you invoke the retHashVal and both parameters are scalars, while in it's body you would use the array's default variable in assigning to $n and $i .. how things are working there? depending on context I'd say that @_ would be converted implicitly to a scalar, is this how it goes in this case?
  • Comment on Re^2: Comparing Hash's key to an <STDIN> and print it's corresponding value

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-16 19:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found