in reply to Difference between for and foreach
for ($x = 1; $x <= 10; $x ++) { ... }
and the other sort
for $x ( 1 .. 10 ) { ... }
Both can be written with foreach instead of for as the former is just a synonym for the latter. See the sections on loops in perlsyn.
Cheers,
JohnGG
|
---|