http://www.perlmonks.org?node_id=439742


in reply to Re^2: Foreach Loops
in thread Foreach Loops

That's why I said "Not so clear":
for(1..@arr){ print $arr[--$_], $_, $/ }


Replies are listed 'Best First'.
Re^4: Foreach Loops
by samtregar (Abbot) on Mar 15, 2005 at 20:44 UTC
    Actually you said "not so clean" not "not so clear" and your code didn't start from 1.

    -sam

      My mistake - forgotten s/.$/n/ after "not so clear"