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

Re^3: comparing two array

by citromatik (Curate)
on Jun 17, 2009 at 12:54 UTC ( #772385=note: print w/ replies, xml ) Need Help??


in reply to Re^2: comparing two array
in thread comparing two array

In this case...

print defined $h{$elem} ? "Yes" : "No"; print exists $h{$elem} ? "Yes" : "No"; print $h{$elem} ? "Yes" : "No";

Are all equivalent (give the same result). exists returns true if the specified element in the hash has ever been initialized, even if its current value is undefined. In this case, all elements has been initialized to 1. If you undefine one element of the hash, for example undef $h{$elem}, then $h{$elem} still exists, but its value is undef

citromatik


Comment on Re^3: comparing two array
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (11)
As of 2014-09-19 20:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (145 votes), past polls