summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/Tie
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-21 00:15:27 +0000
committerKarl Berry <karl@freefriends.org>2012-05-21 00:15:27 +0000
commita4c42bfb2337d37da89d789cb8cc226367994e32 (patch)
treec3eabdef5d565a4e515d2be0d9d4d0540bde0250 /Master/tlpkg/tlperl/lib/Tie
parent8274475057f024d35332ac47c2e2f23ea156e6ed (diff)
perl 5.14.2 from siep
git-svn-id: svn://tug.org/texlive/trunk@26525 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Tie')
-rw-r--r--Master/tlpkg/tlperl/lib/Tie/Array.pm8
-rw-r--r--Master/tlpkg/tlperl/lib/Tie/Hash.pm19
-rw-r--r--Master/tlpkg/tlperl/lib/Tie/Hash/NamedCapture.pm21
-rw-r--r--Master/tlpkg/tlperl/lib/Tie/RefHash.pm9
4 files changed, 30 insertions, 27 deletions
diff --git a/Master/tlpkg/tlperl/lib/Tie/Array.pm b/Master/tlpkg/tlperl/lib/Tie/Array.pm
index af8f51e9f51..4e980a81fce 100644
--- a/Master/tlpkg/tlperl/lib/Tie/Array.pm
+++ b/Master/tlpkg/tlperl/lib/Tie/Array.pm
@@ -3,7 +3,7 @@ package Tie::Array;
use 5.006_001;
use strict;
use Carp;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
# Pod documentation after __END__ below.
@@ -152,9 +152,9 @@ Tie::Array - base class for tied arrays
package main;
- $object = tie @somearray,Tie::NewArray;
- $object = tie @somearray,Tie::StdArray;
- $object = tie @somearray,Tie::NewStdArray;
+ $object = tie @somearray,'Tie::NewArray';
+ $object = tie @somearray,'Tie::StdArray';
+ $object = tie @somearray,'Tie::NewStdArray';
diff --git a/Master/tlpkg/tlperl/lib/Tie/Hash.pm b/Master/tlpkg/tlperl/lib/Tie/Hash.pm
index 1ca8887e7e3..1acd829c347 100644
--- a/Master/tlpkg/tlperl/lib/Tie/Hash.pm
+++ b/Master/tlpkg/tlperl/lib/Tie/Hash.pm
@@ -1,6 +1,6 @@
package Tie::Hash;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
=head1 NAME
@@ -197,9 +197,20 @@ sub new {
sub TIEHASH {
my $pkg = shift;
- if (defined &{"${pkg}::new"}) {
- warnings::warnif("WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing");
- $pkg->new(@_);
+ my $pkg_new = $pkg -> can ('new');
+
+ if ($pkg_new and $pkg ne __PACKAGE__) {
+ my $my_new = __PACKAGE__ -> can ('new');
+ if ($pkg_new == $my_new) {
+ #
+ # Prevent recursion
+ #
+ croak "$pkg must define either a TIEHASH() or a new() method";
+ }
+
+ warnings::warnif ("WARNING: calling ${pkg}->new since " .
+ "${pkg}->TIEHASH is missing");
+ $pkg -> new (@_);
}
else {
croak "$pkg doesn't define a TIEHASH method";
diff --git a/Master/tlpkg/tlperl/lib/Tie/Hash/NamedCapture.pm b/Master/tlpkg/tlperl/lib/Tie/Hash/NamedCapture.pm
index 58ae743d874..932e4404d17 100644
--- a/Master/tlpkg/tlperl/lib/Tie/Hash/NamedCapture.pm
+++ b/Master/tlpkg/tlperl/lib/Tie/Hash/NamedCapture.pm
@@ -1,23 +1,10 @@
+use strict;
package Tie::Hash::NamedCapture;
-our $VERSION = "0.06";
+our $VERSION = "0.08";
-# The real meat implemented in XS in universal.c in the core, but this
-# method was left behind because gv.c expects a Purl-Perl method in
-# this package when it loads the tie magic for %+ and %-
-
-my ($one, $all) = Tie::Hash::NamedCapture::flags();
-
-sub TIEHASH {
- my ($pkg, %arg) = @_;
- my $flag = $arg{all} ? $all : $one;
- bless \$flag => $pkg;
-}
-
-tie %+, __PACKAGE__;
-tie %-, __PACKAGE__, all => 1;
-
-1;
+require XSLoader;
+XSLoader::load(); # This returns true, which makes require happy.
__END__
diff --git a/Master/tlpkg/tlperl/lib/Tie/RefHash.pm b/Master/tlpkg/tlperl/lib/Tie/RefHash.pm
index f95bf41efdf..ed72abc90ed 100644
--- a/Master/tlpkg/tlperl/lib/Tie/RefHash.pm
+++ b/Master/tlpkg/tlperl/lib/Tie/RefHash.pm
@@ -2,7 +2,7 @@ package Tie::RefHash;
use vars qw/$VERSION/;
-$VERSION = "1.38";
+$VERSION = "1.39";
use 5.005;
@@ -71,6 +71,11 @@ cloning of tied refhashes.
This version of Tie::RefHash seems to no longer work with 5.004. This has not
been throughly investigated. Patches welcome ;-)
+=head1 LICENSE
+
+This program is free software; you can redistribute it and/or modify it under
+the same terms as Perl itself
+
=head1 MAINTAINER
Yuval Kogman E<lt>nothingmuch@woobling.orgE<gt>
@@ -159,7 +164,7 @@ my $storable_format_version = join("/", __PACKAGE__, "0.01");
sub STORABLE_freeze {
my ( $self, $is_cloning ) = @_;
my ( $refs, $reg ) = @$self;
- return ( $storable_format_version, [ values %$refs ], $reg );
+ return ( $storable_format_version, [ values %$refs ], $reg || {} );
}
sub STORABLE_thaw {