@arr = (1 .. 20); foreach $i ( 0 .. $#arr ) { # do something }