http://www.perlmonks.org?node_id=1047003


in reply to Re: Removing certain lines from array
in thread Removing certain lines from array

You should turn warnings on and rerun this script.

Iterating over the array in reverse will avoid the problem of the loop indices needing adjustment after an element is deleted.

Update: You changed the script while I was replying. Your description doesn't match now, although I suspect it will in a moment. ;o)

  • Comment on Re^2: Removing certain lines from array

Replies are listed 'Best First'.
Re^3: Removing certain lines from array
by VGavara (Novice) on Jul 30, 2013 at 12:33 UTC

    Sorry Loops, I made some changes before reading your comment. In fact the original script didn't work and I think your comment is not suitable for the new one. Sorry again, newbie behind the wheel :/