I'd like to see eq and it's brethen retained, as dammit there are times
I want to know (-w) if numbers are turning up when there should be
words and vice-versa.  However, spinning off of something Randal wrote:

> Yes, but what about:
> 
>         $a = '3.14'; # from reading a file
>         $b = '3.1400'; # from user input
> 
>         if ($a == $b) { ... } # should this be string or number comparison?

Since we have distinct comparison operators for strings and numbers, and
since we have explict casting for those who wish it, IMHO one can do

    if ( int( $a ) == int( $b ) ) 

to force int (or float) compares, and

    if ( "$a" eq "$b" )

to force string compares, 

IMHO the code

    $a = '3.14'; # from reading a file
    $b = '3.1400'; # from user input
    if ($a == $b) { ... }

should see the two args being tested in numeric context, do the numeric
casting, get floats, and do a floating compare.  Durned if I know what it
does now.

Reply via email to