sub getArrayIndex { my $value = shift; for my $index(0..$#_) { return $index if $value eq $_[$index]; } return -1; }