Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Splice of ref to AoH not removing element

by liz (Monsignor)
on May 30, 2004 at 12:59 UTC ( [id://357606]=note: print w/replies, xml ) Need Help??


in reply to Re: Splice of ref to AoH not removing element
in thread Splice of ref to AoH not removing element

Adding to or removing from an array you're iterating over is a bad idea. If you create a loop over two elements (indices 0 and 1) and, on the first iteration, remove one element, what will happen on the second iteration?

However, if you would iterate in reverse order (1,0) then there would be no problem at all.

Liz

  • Comment on Re: Re: Splice of ref to AoH not removing element

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-04-19 19:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found