Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Best Hash Practices?

by gloryhack (Deacon)
on Oct 09, 2009 at 02:56 UTC ( [id://800148]=note: print w/replies, xml ) Need Help??


in reply to Re: Best Hash Practices?
in thread Best Hash Practices?

1. I don't know of any way to cause a hash key to be created by use of an "if" test.
if ($hash{foo} = 42) { print "The answer to life, the universe, and everything is contained + within foo!\n"; }
So the answer to life, the universe, and everything is simply a common error.

Replies are listed 'Best First'.
Re^3: Best Hash Practices?
by Marshall (Canon) on Oct 09, 2009 at 04:43 UTC
    This if ($hash{foo} = 42) is an assignment statement and the if tests the result of that.
     if ($hash{foo} == 42) would probably do something else.

    for all my goofs above, I don't see how a properly formatted, syntactically correct "if" statement, a question in essence, can cause a new element to be entered into a data structure. I can see how this above statement could do that, but that is because it is more than a simple logical "if".

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 22:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found