in reply to Re^3: Why does exists cause autovivication?
in thread Why does exists cause autovivication?
Near the bottom:
"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."
I would not expect something that just returns true or false to modify the data that is passed to it. I know that people are going to say that it is not modifying the data passed to it - because you are actually dereferencing the hash elements in the CALL to exists() - not within exists itself. However, there must be some way to prevent it from happening when calling exists(). If any one of the lower hash keys does not exist in the hash being tested, then obviously the one you're testing for does not, and exists() should just return false.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Why does exists cause autovivication?
by 1nickt (Canon) on Jul 19, 2017 at 21:21 UTC |