Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Autovivification identification

by choroba (Chancellor)
on Aug 01, 2013 at 09:42 UTC ( #1047406=note: print w/ replies, xml ) Need Help??


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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047406]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2016-06-25 22:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (327 votes). Check out past polls.