Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: Smart matching is experimental/depreciated in 5.18 - recommendations?

by ikegami (Pope)
on Jun 17, 2013 at 20:54 UTC ( #1039472=note: print w/replies, xml ) Need Help??

in reply to Smart matching is experimental/depreciated in 5.18 - recommendations?

Let's start with some background as to what's going on.

There are problems with the implementation. The decision of what any given TYPE ~~ TYPE should do is most often unobvious, inconsistent and/or disputed. The idea isn't to remove smart matching; it's to fix it.

Specifically, ~~ will be greatly simplified, as you can see in a proposal by the 5.18 pumpking. Decisions as to how two things should match will be done with helpers such as those that already exist in Smart::Match.

... ~~ any(...)

Much more readable, much more flexible (fully extensible), and solves a number of problems (such as "When should X be considered a number, and when should it be considered a string?").

So, if you like the feel of given+when, I recommend that you use experimental to disable the warnings and convert your code to use Smart::Match. Smart::Match uses overloaded objects and/or code refs, and that will continue to be supported. I'm hopeful that Smart::Match will be updated if necessary should the details change.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1039472]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2018-03-24 09:02 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (297 votes). Check out past polls.