In Perl, I know of three ways to test objects for equality: ==
, eq
, and ~~
. All of these tell me that 1
is equal to "1"
in Perl 5.
However, 1
and "1"
are not the same thing. How can I compare two objects so that 1
equals 1
, "1"
equals "1"
, 1
does not equal "1"
or 2
, and "1"
does not equal "01"
? Answers for both Perls would be appreciated.