in reply to Re: Sparing multiple 'or's
in thread Sparing multiple 'or's

I would prefer to use the function 'any' from List::MoreUtils rather than 'grep' because the name seems to make the intention clearer. It may even be slightly faster because it can quit at the first match.
Bill

Replies are listed 'Best First'.
Re^3: Sparing multiple 'or's
by AnomalousMonk (Archbishop) on Jun 04, 2018 at 20:26 UTC

    A bunch of stuff (everything?) from List::MoreUtils was migrated | copied to the core module List::Util some time ago, including any() used by Eily in the example here. (But List::MoreUtils is still around for those on ancient systems :)


    Give a man a fish:  <%-{-{-{-<

      How can I easily find out from which version on this is available in core?

      I checked 5.16 and 5.18 and both still say

      SUGGESTED ADDITIONS The following are additions that have been requested, but I hav +e been reluctant to add due to them being very simple to implement in +perl # One argument is true sub any { $_ && return 1 for @_; 0 }

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Re^3: Sparing multiple 'or's
by LanX (Saint) on Jun 04, 2018 at 18:54 UTC
    Sure , but

    >corelist List::MoreUtils Data for 2013-01-20 List::MoreUtils was not in CORE (or so I think)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery