in reply to autovivication gonna make me lose my mind
If you're dereferencing an element as an lvalue (i.e., in a kind of assignment), it will autovivify. If you're dereferencing otherwise, it will fail.
For example:
$ perl -le 'use strict;my %h;push @{$h{first}}, "hello";print $h{first +}' ARRAY(0x8153d78) $ perl -e 'use strict;my %h;print @{$h{first}}, "hello";' Can't use an undefined value as an ARRAY reference at -e line 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: autovivication gonna make me lose my mind
by dreadpiratepeter (Priest) on Sep 16, 2008 at 16:06 UTC | |
|
Re^2: autovivication gonna make me lose my mind
by ig (Vicar) on Nov 04, 2008 at 14:06 UTC |