- or download this
@arr = (1 .. 20);
foreach $i ( 0 .. $#arr ) {
# do something
}
- or download this
foreach $i ( 0 .. 19 ) {
# do something
}
- or download this
foreach $i (1 .. 20)) {
# do something
}
- or download this
foreach $i (@arr)) {
# do something
}