Do you know where your variables are? | |
PerlMonks |
Re^5: 5.24 -> 5.28 -- what has changed in autovivification?by leszekdubiel (Scribe) |
on Apr 18, 2020 at 20:45 UTC ( [id://11115744]=note: print w/replies, xml ) | Need Help?? |
I've found: The documentation for the exists operator no longer says that autovivification behaviour "may be fixed in a future release". We've determined that we're not going to change the default behaviour. perl #127712perl #127712 I understand that there are only two options:
I hoped to find solution that doesn't autovifify when existence is checked, so I could just act like this if (exists $h{a}{b}{c}{d}) { ... } and not like this if (exists $h{a} && exists $h{a}{b} && exists $h{a}{b}{c} && exists $h{a}{b}{c}{d}) { ... } My preferred default behaviour would be to return undef for $h{a}{b}{c}{d} and NOT create $h{a}, $h{a}{b}, $h{a}{b}{c}... This is not possible.
In Section
Seekers of Perl Wisdom
|
|