in reply to Re^4: Looping through a hash reference is creating a key...?
in thread Looping through a hash reference is creating a key...?
I have to wonder if exists could be patched to not have this behavior. Short-circuiting comes to mind.It wouldn't be easy. By the time the exists op is called, all but one of the derefs has already taken place. IE exists is essentially a binary operator taking a hash and key as args:
is executed as:exists $hash{a}{b}{c}
exists(%{$hash{a}{b}}, 'c')
Dave.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Exists and autovivification (was: Looping through a hash reference...)
by Roy Johnson (Monsignor) on Jun 12, 2004 at 01:12 UTC | |
by ihb (Deacon) on Jun 13, 2004 at 17:18 UTC | |
by Roy Johnson (Monsignor) on Jun 13, 2004 at 20:38 UTC | |
by tye (Sage) on Jun 24, 2004 at 19:44 UTC |