Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Autovivification identification

by choroba (Cardinal)
on Aug 01, 2013 at 09:42 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1047406]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-03-19 10:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found