if key1 didn't exist - it pops into existence. This is a process called autovivification
I always wondered what the design decision behind this autovivification behaviour with mere existence testing had been... I mean why does Perl not simply do a short-circuit evaluation from left to right, stopping as soon as a hash key does not exist? In the example, key2 can't possibly exist if there is no hash referenced via key1 at all, because there is not even a key1. So why proceed any further?
In reply to Re^2: Best Multidimensional Hash Practices?
by almut
in thread Best Multidimensional Hash Practices?
by DamianKaelGreen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |