Using for you can initialize variable, condition check and increment the varaibles like 'C' or like some other languages. foreach is a function having in perl using you can get the array variable and you cannot initialize or condition check or increment like 'for' in a single line.
Gubs
In reply to Re: Difference between for and foreach
by gube
in thread Difference between for and foreach
by dilip_val
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |