in reply to Idiomatic Array Index Search?
sub arrayindex { my $value = shift; for (0..$#_) { return $_ if $_[$_] eq $value; } return -1; }
my $index; for $index (0..$#values) { last if $values[$index] eq $value; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Idiomatic Array Index Search?
by MeowChow (Vicar) on May 27, 2001 at 04:13 UTC |