Thanks everyone for your replies
I was assuming that the initialization of elements 0 to 5 was implicitly done by perl.
From Learning Perl 5th Ed. If you store an array element that is beyond the end of the array, the array is automatically extended as needed - there's no limit on its length, as long as there's available memory for Perl to use. If Perl needs to create intervening elements, it creates them as undef values.
So this led me to expect that exists would work here while defined won't. Of course the dumper output doesn't help the confusion.
In reply to Re: Exists and arrays
by deepakg
in thread Exists and arrays
by deepakg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |