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

Any particular reason for @ARGV-1 instead of $#ARGV?

Replies are listed 'Best First'.
Re^3: How can I delete an element in a foreach cycle?
by shmem (Chancellor) on Feb 27, 2010 at 11:29 UTC

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

      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.