List::Util::MaybeXS - List::Util but with Pure Perl fallback
use List::Util::MaybeXS qw( reduce any all none notall first reductions max maxstr min minstr product sum sum0 pairs unpairs pairkeys pairvalues pairfirst pairgrep pairmap shuffle uniq uniqint uniqnum uniqstr zip mesh );
This module provides the same functions as List::Util, but falls back to pure perl implementations if the installed List::Util is too old to provide them.
Picking between List::Util's XS accellerated functions and the PP versions is done on a per-sub basis, so using this module should never result in a slowdown over using List::Util directly.
The variables $List::Util::RAND, $List::Util::PP::RAND, and $List::Util::MaybeXS::RAND are all aliased to each other. Any of them will impact both List::Util::PP and List::Util functions.
$List::Util::RAND
$List::Util::PP::RAND
$List::Util::MaybeXS::RAND
As the subs provided are implemented in perl, there are some minor differences with the interface.
@_
Inside a callback block (such as any { }), @_ will be empty when using the pure perl implementation. With the XS implementation, the outer @_ will be visible. Under the perl debugger, the XS implementation will also not be able to see the outer @_.
any { }
Graham Knop <haarg@haarg.org>
Paul Evans <leonerd@leonerd.org.uk>
Graham Barr <gbarr@pobox.com>
None so far.
Copyright (c) 2017 the List::Util::MaybeXS "AUTHORS" and "CONTRIBUTORS" as listed above.
This library is free software and may be distributed under the same terms as perl itself. See http://dev.perl.org/licenses/.
To install List::Util::MaybeXS, copy and paste the appropriate command in to your terminal.
cpanm
cpanm List::Util::MaybeXS
CPAN shell
perl -MCPAN -e shell install List::Util::MaybeXS
For more information on module installation, please visit the detailed CPAN module installation guide.