in reply to for vs foreach?
But sometimes it's more intuitive to use for(;;) when you are processing only, say, every third item in a list.foreach my $thing(@things){ process($thing); }
for(my $i=0;$i < scalar(@things); $i += 3){ process($things[$i]); }
|
|---|