sub find { my($var, @array); $var =$_[0]; @array=@_[1..$#_];; my $index = 0; ++$index until $array[$index] == $var or $index > $#array; #print "@array\n"; #print "$array[$index]\n"; return $index; } $result = &find (‘Q', @fsg); print "$result\n $fsg[$result]\n”; # returns index for the first non-integer regardless of what that item is $result = &find (‘2', @fsg); print "$result\n $fsg[$result]\n”; # returns correct index $result = &find (‘102', @fsg); print "$result\n $fsg[$result]\n”; # returns the length as the array as the index - which is the value I check to see if a match occurred or not.