in reply to Is list member

Actually, that IS how you handle numeric values. Perl is absolutely typeless - meaning that it implicitly stringifies and numifies variables in the right context. Now, numification often gets you 0 which makes alot of things match where you want them not to. However, stringification will usually get matches properly, when comparing two numbers.

ps: Perl 6! $foo =~ @array

Cheers,
Erik

Replies are listed 'Best First'.
Re: Re: Is list member
by Zaxo (Archbishop) on May 06, 2002 at 08:53 UTC

    Careful, there are unequal strings that are equal as numbers:

    $ perl -e'$c="10e0";$d="1e1";print $c == $d,$/' 1 $ perl -e'$c="10e0";$d="1e1";print $c eq $d,$/' $ perl -e'$c=10e0;$d=1e1;print $c eq $d,$/' 1 $ perl -e'$c=10e0;$d=1e1;print $c == $d,$/' 1
    I think this question is best solved by redesigning it away.

    After Compline,
    Zaxo