[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: exists $foo[7] and delete $foo[7]



On Thu, 13 Jan 2000 13:06:30 EST, Ronald J Kimball wrote:
>If you want to use delete() and exists() on arrays, you really want to use
>a hash instead.

Hashes take a lot more memory than arrays, or haven't you noticed?

>I dread the day when push(), pop(), shift(), unshift(), and splice() are
>extended to work on hashes...

I guess you haven't noticed a tiny module on CPAN that goes by the name
Tie::IxHash, or who had occasion to write it... :-)

But seriously, unless we can make perl's hashes order-preserving with
zero cost (which seems unlikely), push/pop/shift/unshift/splice can
never be supported on hashes.


Sarathy
gsar@ActiveState.com


Follow-Ups from:
Ronald J Kimball <rjk@linguist.dartmouth.edu>
References to:
Ronald J Kimball <rjk@linguist.dartmouth.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]