I am surprised that perl is inefficient with sparse arrays.
It's more than a little inaccurate to say that, given that Perl doesn't even attempt to implement sparse arrays.
You might just as well say that Perl is inefficient at implementing birth control or nuclear fusion :)
I guess that if I need to create one, I should in future use a hash with numbers as the keys.
Indeed. If your "array" is likely to be less that 45% full, using a hash with numeric keys will save you memory at the cost of a little speed.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |