Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Can this script be Optimized?

by kcott (Archbishop)
on May 01, 2014 at 09:03 UTC ( [id://1084588]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Can this script be Optimized?
in thread Can this script be Optimized?

Thanks for the feedback.

I had seen the C and pure-Perl implementation information in List::MoreUtils [from CPAN]; however, the List::Util [from perldoc.perl.org] documentation made no mention of this: hence the "As far as I know" qualifier.

I was a little surprised when you mentioned there was an overlap between these two modules as I wasn't aware of this. I did a little investigation and found:

http://perldoc.perl.org/List/Util.html

Indicates Perl v5.18.2 and only shows these functions: first max maxstr min minstr reduce shuffle sum. It does show any, all, et al, which currently exist in List::MoreUtils, as suggested additions which haven't been included. (I couldn't find any mention of a module version number.)

http://search.cpan.org/~pevans/Scalar-List-Utils-1.38/lib/List/Util.pm

This does show any, all, et al as being included.

$ perldoc List::Util

This appears to be the same doco as the CPAN version. Checking my versions: List::Util 1.38 and Perl 5.18.1

I have, up until now, used the perldoc.perl.org documentation for all builtin modules. It's clear that this is out-of-date for List::Util (i.e. it's not the POD that ships with 5.18.2); unfortunately, this leave me wondering what other parts of its doco aren't up-to-date.

-- Ken

Replies are listed 'Best First'.
Re^4: Can this script be Optimized?
by tobyink (Canon) on May 01, 2014 at 23:14 UTC

    Beginning with List::Util 1.28, List::Util added a great deal of new functions. However, the version of List::Util included in the Perl 5.18.x releases is 1.27. (And perldoc.perl.org only includes documentation for modules bundled with stable releases of Perl.)

    The new functions are:

    • Added in 1.28: pairgrep, pairmap, pairs, pairkeys, and pairvalues.
    • Added in 1.30: pairfirst.
    • Added in 1.33: any, all, none, and notall. ← these are the ones which overlap with List::MoreUtils
    • Added in 1.35: product.

    I don't know what version of List::Util will be bundled with Perl 5.20.0, but it's likely to be at least 1.38. Of course, you don't need to wait for Perl 5.20.0 to use these functions; List::Util 1.38 is already on CPAN.

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

      Thanks for tracking down all that info. It would appear my concerns about perldoc.perl.org not being up-to-date are unfounded.

      "Of course, you don't need to wait for Perl 5.20.0 to use these functions; List::Util 1.38 is already on CPAN."

      Actually, I don't have to wait or, indeed, do anything at all. :-)

      As stated above:

      "... my versions: List::Util 1.38 and Perl 5.18.1"

      I didn't (deliberately) install List::Util 1.38, so it must have been a dependency of some other module I installed via cpan.

      -- Ken

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-24 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found