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:
(tested with 5.9.5). See perlsyn for details on how smart match works.use feature ":5.10"; my $x=10; my $y="10.00"; say "matches" if ($x ~~ $y);
In reply to Re: Equality checking for strings AND numbers - the future
by tirwhan
in thread Equality checking for strings AND numbers
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |