in reply to Re: Exists and arrays
in thread Exists and arrays

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.
This is just correct enough to be misleading. Assigning to an OOB element of an array @a modifies $#a, and (I assume) Data::Dumper is using $#a to decide how big @a is. (See STORESIZE in perltie.) It's true that trying to access ‘intervening’ elements will return undef, but it's not true that those elements were ‘created’ by the STORESIZE.