in reply to Unexpected exists() behavior
"This surprising autovivification in what does not at first--or even second--glance appear to be an lvalue context may be fixed in a future release."undef $ref; if (exists $ref->{"Some key"}) { } print $ref; # prints HASH(0x80d3d5c)
Translating 'autovivication' from the ancient Latin I get: "of bringing itself to life," so I take it to mean "self-define" in the context.
As for a workaround, I would expect using 'defined()' instead of 'exists()' ought to do it.
-M
Free your mind
|
|---|