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

Re: Check if hash key value pair is defined

by Anonymous Monk
on Nov 15, 2012 at 14:18 UTC ( #1004021=note: print w/ replies, xml ) Need Help??

in reply to Check if hash key value pair is defined

A data structure as-described must consist of a hash whose values are arrayrefs (or hashrefs). Therefore, first check to see if the key exists(), then use e.g. grep() to look for the desired value.

Be consistent: Arrange the program so that the hash always contains an arrayref, even if it contains only one entry. Perl's "auto-vivification" features make the necessary code for building the structure short-and-sweet.

Comment on Re: Check if hash key value pair is defined

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2015-11-29 13:30 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (751 votes), past polls