in reply to Disadvantage of using 'eq' operator to compare numbers.
>perl -le"print 1 == '1.0' ?1:0" 1 >perl -le"print 1 eq '1.0' ?1:0" 0
If you want two to be less than ten, you want the numerical operators:
>perl -le"print 2 < 10 ?1:0" 1 >perl -le"print 2 lt 10 ?1:0" 0
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Disadvantage of using 'eq' operator to compare numbers.
by dsheroh (Monsignor) on Jan 02, 2010 at 14:01 UTC |