# prototype here for "look and feel good"ness # if you remove it, be sure to pass array by # reference (this is done for speed reasons) # $index = get_index @array, $element; sub get_index (\@$) { my ($a, $e) = @_; my $i = 0; for (@$a) { return $i if $e eq $_; $i++; } return -1; }