http://www.perlmonks.org?node_id=1047406


in reply to Re: Autovivification identification
in thread Autovivification identification

Note that in recent Perl (since 5.14), push can take an array reference as the first argument. This is an experimental feature and no autovivification happens here:
my $x = []; push $x, 0, 1, 2; # OK push $x->[3], 'ouch'; # Error: array reference expected.
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^3: Autovivification identification
by Random_Walk (Prior) on Aug 02, 2013 at 08:14 UTC

    I did not know that. I kinda like it, but I am not sure if it leads to more readable code for those who come after me.

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!