Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^2: Pop/shift/delete on array

by Limbic~Region (Chancellor)
on Jul 14, 2005 at 12:34 UTC ( #474851=note: print w/replies, xml ) Need Help??

in reply to Re: Pop/shift/delete on array
in thread Pop/shift/delete on array

Finally delete isn't an array function, it's used for deleting a hash element.

While I have yet to see a good use for using delete on an array, this is misinformation. The docs for delete clearly indicate it can be used for arrays and array slices though it behaves differently then if it had been performed on a hash. It is designed to work with exists on array elements which I find just as icky. If the element isn't at the either end, I prefer to use splice to get rid of it even though I hear the cost of splicing an array is proportional to the size of the array at time of splicing.

Cheers - L~R

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://474851]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2019-10-15 05:59 GMT
Find Nodes?
    Voting Booth?