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".