Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: using smartmatch for range matching

by hippo (Bishop)
on Nov 25, 2023 at 16:22 UTC ( [id://11155821]=note: print w/replies, xml ) Need Help??


in reply to using smartmatch for range matching

Yes, smartmatch is deprecated. It is going away entirely in Perl 5.42. Follow the link for reasoning.

Is there a more elegant solution similar to the smartmatch example?

Well, there are plenty of modules you could use. Perhaps Number::Range? I have not used it but it might fit the bill.

Note also that although deprecated and depreciated are similar words they do not mean the same thing.


🦛

  • Comment on Re: using smartmatch for range matching

Replies are listed 'Best First'.
Re^2: using smartmatch for range matching
by perltux (Monk) on Nov 25, 2023 at 16:33 UTC
    I try to avoid using non core modules as much as possible as they would make my programs less portable (most Linux distros offer only a limited selection of packaged Perl modules and using cpan is not an option if I want to package my program for a Linux distro).

    So to reformulate my question: Is there a more elegant solution similar to the smartmatch example and without using non-core modules?


    Quoting from the link you kindly provided with regards to deprecation of smartmatch:

    " its behavior is noticed for being unnecessarily complex and unintuitive"

    It looks like the "dumbing down everything" disease has sadly reached Perl too... :-(

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11155821]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-05-23 16:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found