in reply to foreach problem with shift

I'm sorry, The above question is asked by me only

.

Replies are listed 'Best First'.
Re^2: foreach problem with shift
by Corion (Patriarch) on Mar 04, 2009 at 10:40 UTC

    Read perlsyn about foreach:

    If any part of LIST is an array, foreach will get very confused if you add or remove elements within the loop body, for example with splice. So don't do that.