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
In reply to Re: Difference between for and foreach
by johngg
in thread Difference between for and foreach
by dilip_val
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |