![]() |
|
Perl: the Markov chain saw | |
PerlMonks |
Re^4: hash and array mismatchby TGI (Parson) |
on May 10, 2007 at 20:19 UTC ( #614755=note: print w/replies, xml ) | Need Help?? |
I knew that autovivification would let you do things like $foo{a}{b}{c} = 7; I just didn't know that it worked for push and friends as well. Which is funny, because in perlreftut, it discusses the push related aspect. I know I read perlreftut a few years ago. I guess this tidbit failed to stick. For reference purposes, you can also do:
Thanks for the pointer to autovivification. I obviously didn't understand it properly when I was first learning, and never really came back to the subject. Methinks I need to carefully reread Chapter 8 of Programming Perl.
In Section
Seekers of Perl Wisdom
|
|