Think about Loose Coupling | |
PerlMonks |
Re^2: check if 2 values are equalby clinton (Priest) |
on Jan 24, 2006 at 19:31 UTC ( [id://525296]=note: print w/replies, xml ) | Need Help?? |
I think you can do away with the third condition of ($val1 == $val2). First, the eq should catch differences between numbers equally well as the ==. See Comparing values. Secondly, the == would fail (under strict) if one of the values were a string. For eq to work for numbers, you need to know that the values are being represented internally as numbers, for instance:
In Section
Seekers of Perl Wisdom
|
|