in reply to Re^2: How can I delete an element in a foreach cycle?
in thread How can I delete an element in a foreach cycle?

Other than TIMTOWTDi, no ;-) But $#ARGV is better, since it needn't be calculated. - corrected, thanks.

Replies are listed 'Best First'.
Re^4: How can I delete an element in a foreach cycle?
by ikegami (Patriarch) on Mar 01, 2010 at 03:43 UTC

    In 5.10.0 and 5.10.1, $#a adds magic, so there's a performance penalty to $#a too. Either way, the cost has got to be minor.

    Note that $#a only adds magic when $#a is used in an lvalue context in 5.12.