in reply to Re: Nested Foreach Loop skipping every other element??
in thread Nested Foreach Loop skipping every other element??

So should how else can I delete that element??
  • Comment on Re^2: Nested Foreach Loop skipping every other element??

Replies are listed 'Best First'.
Re^3: Nested Foreach Loop skipping every other element??
by hdb (Monsignor) on Feb 19, 2014 at 16:47 UTC

    Instead of deleting the unwanted ones, you could push the wanted ones onto a new list. Or try to rewrite your conditions into a grep statement.

Re^3: Nested Foreach Loop skipping every other element??
by vinoth.ree (Monsignor) on Feb 19, 2014 at 17:00 UTC

    Instead doing splice on the same @DIR which you used in the foreach, you can have a copy of @DIR and you can do splice on that array. For Ex. @DIR will be used in foreach, @DIR_COPY can be used in splice.


    All is well