foreach (my $i=0; $i<10; $i++) { print "$i\n"; } for my $i (0..9) { print "$i\n"; }