++$index until $array[$index] == $var or $index > $#array;
to
++$index until $array[$index] eq $var or $index > $#array;
Perl has both a string equality operator eq and a numeric equality operator ==. Integers will be stringwise equivalent to themselves, but strings evaluate to zero in numeric context (unless they look like numbers), so nearly all strings are numerically equivalent in Perl. See Equality Operators in perlop for details.
In reply to Re: Searching mixed array?
by kennethk
in thread Searching mixed array?
by edieguez
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |