Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: What is the best way to find the key is exists or not in a hash ?

by vladdrak (Monk)
on May 11, 2005 at 06:10 UTC ( #455866=note: print w/replies, xml ) Need Help??


in reply to What is the best way to find the key is exists or not in a hash ?

if (grep/^keyvalue$/, keys %data) { print "yes"; } # and if (defined $data{keyvalue}) { print "yes"; } # and if you also are sure there is value data in your hash if ($data{keyvalue}) { print "yes"; }


-Vlad
  • Comment on Re: What is the best way to find the key is exists or not in a hash ?
  • Download Code

Replies are listed 'Best First'.
Re^2: What is the best way to find the key is exists or not in a hash ?
by swaroop (Beadle) on May 11, 2005 at 10:40 UTC
    Sorry guys, I just want to know the methods to findout the key is exists or not. I need to process more then 500000 values.

    Thanks for the replys.

    - Swaroop

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-01-29 15:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?