summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/List
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-11-20 18:08:54 +0000
committerKarl Berry <karl@freefriends.org>2012-11-20 18:08:54 +0000
commitc5add2ea5067382269ae6f19e345fda0b9a7bd21 (patch)
tree02f512fda46d93079c9dc59c0d76f0e398150f83 /Master/tlpkg/tlperl/lib/List
parent6c35e87bdc5a3f64833dbbc42e7d42e683db9d5b (diff)
perl 5.16.2, compiled without optimization for Windows (from siep)
git-svn-id: svn://tug.org/texlive/trunk@28315 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/List')
-rw-r--r--Master/tlpkg/tlperl/lib/List/Util.pm31
-rw-r--r--Master/tlpkg/tlperl/lib/List/Util/PP.pm83
-rw-r--r--Master/tlpkg/tlperl/lib/List/Util/XS.pm14
3 files changed, 11 insertions, 117 deletions
diff --git a/Master/tlpkg/tlperl/lib/List/Util.pm b/Master/tlpkg/tlperl/lib/List/Util.pm
index aced6b15b58..033ef505c0f 100644
--- a/Master/tlpkg/tlperl/lib/List/Util.pm
+++ b/Master/tlpkg/tlperl/lib/List/Util.pm
@@ -9,35 +9,16 @@
package List::Util;
use strict;
-use vars qw(@ISA @EXPORT_OK $VERSION $XS_VERSION $TESTING_PERL_ONLY);
require Exporter;
-@ISA = qw(Exporter);
-@EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle);
-$VERSION = "1.23";
-$XS_VERSION = $VERSION;
+our @ISA = qw(Exporter);
+our @EXPORT_OK = qw(first min max minstr maxstr reduce sum shuffle);
+our $VERSION = "1.25";
+our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
-eval {
- # PERL_DL_NONLAZY must be false, or any errors in loading will just
- # cause the perl code to be tested
- local $ENV{PERL_DL_NONLAZY} = 0 if $ENV{PERL_DL_NONLAZY};
- eval {
- require XSLoader;
- XSLoader::load('List::Util', $XS_VERSION);
- 1;
- } or do {
- require DynaLoader;
- local @ISA = qw(DynaLoader);
- bootstrap List::Util $XS_VERSION;
- };
-} unless $TESTING_PERL_ONLY;
-
-
-if (!defined &sum) {
- require List::Util::PP;
- List::Util::PP->import;
-}
+require XSLoader;
+XSLoader::load('List::Util', $XS_VERSION);
1;
diff --git a/Master/tlpkg/tlperl/lib/List/Util/PP.pm b/Master/tlpkg/tlperl/lib/List/Util/PP.pm
deleted file mode 100644
index 2771329b563..00000000000
--- a/Master/tlpkg/tlperl/lib/List/Util/PP.pm
+++ /dev/null
@@ -1,83 +0,0 @@
-# List::Util::PP.pm
-#
-# Copyright (c) 1997-2009 Graham Barr <gbarr@pobox.com>. All rights reserved.
-# This program is free software; you can redistribute it and/or
-# modify it under the same terms as Perl itself.
-
-package List::Util::PP;
-
-use strict;
-use warnings;
-use vars qw(@ISA @EXPORT $VERSION $a $b);
-require Exporter;
-
-@ISA = qw(Exporter);
-@EXPORT = qw(first min max minstr maxstr reduce sum shuffle);
-$VERSION = "1.23";
-$VERSION = eval $VERSION;
-
-sub reduce (&@) {
- my $code = shift;
- require Scalar::Util;
- my $type = Scalar::Util::reftype($code);
- unless($type and $type eq 'CODE') {
- require Carp;
- Carp::croak("Not a subroutine reference");
- }
- no strict 'refs';
-
- return shift unless @_ > 1;
-
- use vars qw($a $b);
-
- my $caller = caller;
- local(*{$caller."::a"}) = \my $a;
- local(*{$caller."::b"}) = \my $b;
-
- $a = shift;
- foreach (@_) {
- $b = $_;
- $a = &{$code}();
- }
-
- $a;
-}
-
-sub first (&@) {
- my $code = shift;
- require Scalar::Util;
- my $type = Scalar::Util::reftype($code);
- unless($type and $type eq 'CODE') {
- require Carp;
- Carp::croak("Not a subroutine reference");
- }
-
- foreach (@_) {
- return $_ if &{$code}();
- }
-
- undef;
-}
-
-
-sub sum (@) { reduce { $a + $b } @_ }
-
-sub min (@) { reduce { $a < $b ? $a : $b } @_ }
-
-sub max (@) { reduce { $a > $b ? $a : $b } @_ }
-
-sub minstr (@) { reduce { $a lt $b ? $a : $b } @_ }
-
-sub maxstr (@) { reduce { $a gt $b ? $a : $b } @_ }
-
-sub shuffle (@) {
- my @a=\(@_);
- my $n;
- my $i=@_;
- map {
- $n = rand($i--);
- (${$a[$n]}, $a[$n] = $a[$i])[0];
- } @_;
-}
-
-1;
diff --git a/Master/tlpkg/tlperl/lib/List/Util/XS.pm b/Master/tlpkg/tlperl/lib/List/Util/XS.pm
index 2dcb03a28e2..d46853ca234 100644
--- a/Master/tlpkg/tlperl/lib/List/Util/XS.pm
+++ b/Master/tlpkg/tlperl/lib/List/Util/XS.pm
@@ -1,18 +1,10 @@
package List::Util::XS;
use strict;
-use vars qw($VERSION);
use List::Util;
-$VERSION = "1.23"; # FIXUP
+our $VERSION = "1.25"; # FIXUP
$VERSION = eval $VERSION; # FIXUP
-sub _VERSION { # FIXUP
- require Carp;
- Carp::croak("You need to install Scalar-List-Utils with a C compiler to ensure the XS is compiled")
- if defined $_[1];
- $VERSION;
-}
-
1;
__END__
@@ -32,6 +24,10 @@ installed using a C compiler and that the XS version is installed.
During installation C<$List::Util::XS::VERSION> will be set to
C<undef> if the XS was not compiled.
+Starting with release 1.23_03, Scalar-List-Util is B<always> using
+the XS implementation, but for backwards compatibility, we still
+ship the C<List::Util::XS> module which just loads C<List::Util>.
+
=head1 SEE ALSO
L<Scalar::Util>, L<List::Util>, L<List::MoreUtils>