How can I get the current index of an array while processing the array in a loop? I know I can do it with a counter type function, but I was curious if there was a better way of doing this.
For example: my @array = (1 .. 100); my $counter = 0; for (@array) { print "index -> $counter element -> $_\n"; $counter++; } Well, how do I do that without the counter? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]