summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/List/Util.pm
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-04-23 21:46:20 +0000
committerKarl Berry <karl@freefriends.org>2014-04-23 21:46:20 +0000
commit300c1eb6d37d46078d448d6d58938d5a80cd68ff (patch)
tree23a0a8b9f8f5460b405119c4d3c163d2d488ca5e /Master/tlpkg/tlperl/lib/List/Util.pm
parented55d86b7c5e18f6eccce80a1fb1423ca40a23b5 (diff)
(tl)perl 5.18.2 for windows from siep
git-svn-id: svn://tug.org/texlive/trunk@33648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/List/Util.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/List/Util.pm15
1 files changed, 13 insertions, 2 deletions
diff --git a/Master/tlpkg/tlperl/lib/List/Util.pm b/Master/tlpkg/tlperl/lib/List/Util.pm
index 033ef505c0f..5988aa914ec 100644
--- a/Master/tlpkg/tlperl/lib/List/Util.pm
+++ b/Master/tlpkg/tlperl/lib/List/Util.pm
@@ -12,14 +12,20 @@ use strict;
require Exporter;
our @ISA = qw(Exporter);
-our @EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle);
-our $VERSION = "1.25";
+our @EXPORT_OK = qw(first min max minstr maxstr reduce sum sum0 shuffle);
+our $VERSION = "1.27";
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
require XSLoader;
XSLoader::load('List::Util', $XS_VERSION);
+sub sum0
+{
+ return 0 unless @_;
+ goto &sum;
+}
+
1;
__END__
@@ -164,6 +170,11 @@ C<undef> being returned
$foo = sum 0, @values;
+=item sum0 LIST
+
+Similar to C<sum>, except this returns 0 when given an empty list, rather
+than C<undef>.
+
=back
=head1 KNOWN BUGS