Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^7: Smartmatch alternatives

by davido (Archbishop)
on Dec 17, 2013 at 16:37 UTC ( #1067499=note: print w/ replies, xml ) Need Help??


in reply to Re^6: Smartmatch alternatives
in thread Smartmatch alternatives

Well, since I'm running Perl 5.18.2, I guess the fact that I have List::Util::any must mean that somewhere along the way I've installed the latest dual-lived version of the module.

Anyway, is there any disagreement that "any" (under whichever banner it marches) is a reasonable utility for determining if any of the elements in an array meets some criteria? If I recall, it's also a PBP recommendation for the same reason I gave: That, unlike grep, it gives an appropriate and clear name to the functionality at work.


Dave


Comment on Re^7: Smartmatch alternatives
Re^8: Smartmatch alternatives
by tobyink (Abbot) on Dec 17, 2013 at 19:04 UTC

    Certainly no disagreement. The aforementioned match::simple even uses any.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2015-07-02 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls