in reply to Re: Erroneous defined detection of array elements
in thread Erroneous defined detection of array elements
and will not auto-vivify them
defined will not autovivify either:
my @array; if (defined $array[20]) { } # no autovivific +ation, thus if (defined $array[20]) { warn "[20] does exist!" } # no warning
Typically, it's a dereferencing operation that unexpededly autovivifies. exists shares the same problem:
my @array; if (exists $array[20]->[42]) { } if (exists $array[20]) { warn "[20] does exist!" } __END__ [20] does exist! at ./808911.pl line 5.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Erroneous defined detection of array elements
by keszler (Priest) on Nov 23, 2009 at 20:32 UTC | |
by ikegami (Patriarch) on Nov 23, 2009 at 20:44 UTC |