http://qs1969.pair.com?node_id=11114352


in reply to Re: Manually incrementing @ array during for
in thread Manually incrementing @ array during for

Thank you for the prompt reply. I was kinda hoping perl had a way to increment in the array without a shift. But changing to a while (or maybe a classic C for loop) using an index, and your reply contains a nice template!
  • Comment on Re^2: Manually incrementing @ array during for

Replies are listed 'Best First'.
Re^3: Manually incrementing @ array during for
by jcb (Parson) on Mar 17, 2020 at 01:36 UTC

    Generally, languages that provide implicit iteration over aggregates do not provide a way to control the implicit iterator. You will need to either preprocess the @array or use an explicit index variable.