in reply to Equality checking for strings AND numbers

Since noone has mentioned it so far I'd just like to point out that for Perl versions >= 5.9.3 you can use the smart match operator ~~ for this. So for example, the following would work:

use feature ":5.10"; my $x=10; my $y="10.00"; say "matches" if ($x ~~ $y);
(tested with 5.9.5). See perlsyn for details on how smart match works.


All dogma is stupid.