in reply to Re: why does this array take up so much memory?
in thread why does this array take up so much memory?

You can overload array deref. So you could write a class that overloads @{} to return an object of another class also overloading the operator, which finally returns an array constaining the desired element(s), enabling syntax like
my $element = $matrix->[$y]->[$x];
I'll come back later today to add some proof of concept code. Of course you do take a speed hit and the resize restricition doesn't go away, but this would seem to be a case of trading speed for memory anyway.

Makeshifts last the longest.