Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Deleting from the middle of an array is inherently slow, since all the subsequent elements need to be shifted. Locating elements is slow too. Is the data sorted by the search criteria?
Can you use a hash indexed by the search criteria.
If you're stuck with an array, you might want to consider undefing the element instead of deleting it. Just skip the undefs when it's time to save the structure. In reply to Re: Testing if an array contains a value and then deleting it in most efficient way
by ikegami
|
|