my $count=0; foreach $e (@s) { $count ++; print "$e is the $count"."th element\n"; }
Neil Watson
watson-wilson.ca
In reply to Re: Keeping a Count in iforeach/i
by neilwatson
in thread Keeping a Count in foreach
by arunhorne
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |