Bob Showalter wrote:
> ...
> A more efficient iterative approach using a numeric equality test
> would be: 
> 
>    sub checkNumber {
>       $_[0] == $_ && return 1 for @numbers;
>       return;
>    }
> 
> This returns 1 for a match and undef for no match.

Heck, you can even leave off the last "return" there. That will return 1 for
a match and '' for no match (i.e. the result of the last failed == test),
which are still Perl "true" and "false" values.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to