my $foo; $foo->[1] = 42; # automatically sets $foo = [] before the # assignment so you end up with $foo = [undef, 42] instead of # dying with "Can't use undef as an ARRAY reference"