Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Autovivification identification

by ikegami (Pope)
on Aug 02, 2013 at 04:18 UTC ( #1047537=note: print w/replies, xml ) Need Help??


in reply to Autovivification identification

that how perl has been identified that it has to go for Array or Hash Autovivification?

Autovivification is the creation of a variable by a dereference when the variable being dereferenced is undefined.

Perl knows what to create based on the kind of deference used.

  • If you have an array element dereference ($$r[$i], $r->[$i]), it'll create an array.
  • If you have an hash element dereference ($$r{$k}, $r->{$i}), it'll create a hash.
  • If you have an array dereference (@$r), it'll create an array.
  • If you have an hash dereference (%$r), it'll create a hash.
  • etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1047537]
help
Chatterbox?
[Discipulus]: good morning folks!
choroba mornings back
[Corion]: Hi choroba!
[Corion]: And Discipulus!
Corion arrived back from London. Always nice to meet people again, even if it's just once per year.
[Corion]: Also, dk contributed some cool stuff to App::ShaderToy, like menu settings and real fullscreen, eliminating many of my #TO-DO comments ;)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2016-12-06 08:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (101 votes). Check out past polls.