From a4c42bfb2337d37da89d789cb8cc226367994e32 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 21 May 2012 00:15:27 +0000 Subject: perl 5.14.2 from siep git-svn-id: svn://tug.org/texlive/trunk@26525 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/tlperl/lib/Tie/Array.pm | 8 ++++---- Master/tlpkg/tlperl/lib/Tie/Hash.pm | 19 +++++++++++++++---- Master/tlpkg/tlperl/lib/Tie/Hash/NamedCapture.pm | 21 ++++----------------- Master/tlpkg/tlperl/lib/Tie/RefHash.pm | 9 +++++++-- 4 files changed, 30 insertions(+), 27 deletions(-) (limited to 'Master/tlpkg/tlperl/lib/Tie') 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 Enothingmuch@woobling.orgE @@ -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 { -- cgit v1.2.3