![]() |
|
Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I use smartmatch for checking whether an integer number is within a certain range, like this:
if ( $number~~[1416..1494] ) { do whatever } But since i upgraded to a recent Perl version i'm getting a "Smartmatch is deprecated" warning. Why would such a useful operator be depreciated? Do I really have to replace '~~' with: if ( $number>=1416 and $number<=1494 ) { do whatever } Is there a more elegant solution similar to the smartmatch example? Also is this depreciation of smartmatch definitive or is there a chance that the Perl devs will change their mind and keep it? Perl is great because of these brilliant operators, removing them removes a bit of the uniqueness of Perl. In reply to using smartmatch for range matching by perltux
|
|