in reply to help understanding code snippet

Although I don't like to rely on autovivication because it doesn't work for every case. I don't like to follow the boundary of arbitrary rules (unless avoiding tax ;);)) So in my code, for example, you'll find initialisations ahead of the array reference usage like:
$bysource{$source} ||= []; push etc.

One world, one people

Replies are listed 'Best First'.
Re^2: help understanding code snippet
by Eliya (Vicar) on Apr 28, 2011 at 14:59 UTC
    I don't like to rely on autovivication because it doesn't work for every case

    I can't remember to have ever had problems with things not having been autovivified when they should've been. Could you come up with an example where it would fail?

    The problems with autovivification are usually the other way around, i.e. that people don't expect or don't want autovivified items as a side effect...   Luckily, there's now no autovivification for cases like these.