Really simple question.

Peter Corlett abuse at cabal.org.uk
Thu Feb 8 16:07:10 GMT 2007


On Thu, Feb 08, 2007 at 03:35:42PM +0000, Robert Bannocks wrote:
[...]
> foreach (@arrayname) {
>  ...do some stuff..
> }

> other than setting a count before the loop and incrementing it each time
> how can I find out with in ...do some stuff... how far through @arrayname
> I am?

foreach my $index (0..$#arrayname) {
... do stuff with $arrayname[$index] ...
}



More information about the london.pm mailing list