is a reference. A reference in a numeric
context gives you a memory address. Memory addresses are
usually big. Storing an element out of range in an array
will make Perl grow the array so it fits - creating undefined
values to fill up the array. Storing an element using a big
index will make Perl create a huge array, with all the elements taking two handfuls of bytes.
I'd say you're lucky it takes only 50Mb on your system. It dies on one system I tried it on, and it used 420 Mb on another.