This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Scalar-List-Utils from version 1.34 to 1.35
[perl5.git] / cpan / List-Util / lib / List / Util.pm
index 067b60c..452dd29 100644 (file)
@@ -13,10 +13,10 @@ require Exporter;
 
 our @ISA        = qw(Exporter);
 our @EXPORT_OK  = qw(
-  all any first min max minstr maxstr none notall reduce sum sum0 shuffle
+  all any first min max minstr maxstr none notall product reduce sum sum0 shuffle
   pairmap pairgrep pairfirst pairs pairkeys pairvalues
 );
-our $VERSION    = "1.34";
+our $VERSION    = "1.35";
 our $XS_VERSION = $VERSION;
 $VERSION    = eval $VERSION;
 
@@ -36,12 +36,6 @@ sub import
   goto &Exporter::import;
 }
 
-sub sum0
-{
-   return 0 unless @_;
-   goto ∑
-}
-
 1;
 
 __END__
@@ -191,6 +185,14 @@ If the list is empty then C<undef> is returned.
     $foo = minstr "hello","world"   # "hello"
     $foo = minstr @bar, @baz        # whatever
 
+=head2 product LIST
+
+Returns the product of all the elements in LIST. If LIST is empty then C<1> is
+returned.
+
+    $foo = product 1..10            # 3628800
+    $foo = product 3,9,12           # 324
+
 =head2 sum LIST
 
 Returns the sum of all the elements in LIST. If LIST is empty then