Monks...
If i have the following:
foreach $e (@s) { print "$e\n"; }
Obviously this just prints the scalars in @s one per line. However I want to know what number $e is in a list i.e to print:
0 an_item 1 another_item etc.
Can I do this using the foreach structure easily or will I have to resort to a for loop?
Thanks,
</code> ____________In reply to Keeping a Count in foreach by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |