A few days ago, one of the Perl Maven readers asked me about indexing in arrays in Perl, and then he was wondering if arrays that only have elements in some high index are sparse arrays? In other words if we have an array with a single value at index 1,000,000 does Perl allocate space for all the preceding 1,000,000 elements, or is does it take up place for the single element in the array.

In yet other words, how much memory does this use?

my @a;
$a[1_000_000] = 1;