Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Wrong behavior of the implicit smart operator in the given/when blocks

by ikegami (Pope)
on Apr 30, 2012 at 15:45 UTC ( #968104=note: print w/replies, xml ) Need Help??


in reply to Re: Wrong behavior of the implicit smart operator in the given/when blocks
in thread Wrong behavior of the implicit smart operator in the given/when blocks

Specifically, they think the interface is some combination of too confusing, too complex, too error prone. Smart::Match is seen as way better interface.

  • Comment on Re^2: Wrong behavior of the implicit smart operator in the given/when blocks

Replies are listed 'Best First'.
Re^3: Wrong behavior of the implicit smart operator in the given/when blocks
by tobyink (Abbot) on Apr 30, 2012 at 16:40 UTC

    As I understand it, it's DOY's smartmatch which is the possible candidate for future Perls. This pushes the behaviour of smart match out to modules (on a lexically scoped basis). So you can:

    use smartmatch 'acme';

    And then the ~~ operator will start acting along the lines of whatever's defined in the smartmatch::engine::acme module. Perl will then come bundled with a backwards compatible behaviour (modelled on 5.14 most probably) and a simplified one.

    Personally, I tend to follow the rule of keeping the left hand side of the smart match as either a non-reference scalar or a blessed object. If you stick to that, then whatever you put on the right hand side, smart match generally behaves pretty sanely and intuitively. (With the possible exception of when you've got hashref on the right hand side - I'm not sure there's any completely intuitive behaviour in that case, but the current behaviour certainly seems no worse than anything else.)

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968104]
help
Chatterbox?
choroba knows the situation. At work, unit tests run for 30 minutes, and integration and end-to-end tests take almost one hour.
[stevieb]: yeah. This is my build/test software that manipulates perlbrew/ berrybrew, and runs all unit tests of a project against all installed versions, including testing a dist against all of it's current revdeps. A lot of tests it runs for itself:)
[stevieb]: testing the test build system, essentially

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2017-03-26 22:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (315 votes). Check out past polls.