diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-21 00:15:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-21 00:15:27 +0000 |
commit | a4c42bfb2337d37da89d789cb8cc226367994e32 (patch) | |
tree | c3eabdef5d565a4e515d2be0d9d4d0540bde0250 /Master/tlpkg/tlperl/lib/Safe.pm | |
parent | 8274475057f024d35332ac47c2e2f23ea156e6ed (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/Safe.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Safe.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Master/tlpkg/tlperl/lib/Safe.pm b/Master/tlpkg/tlperl/lib/Safe.pm index bca4dfe8e6b..70549c5f4e8 100644 --- a/Master/tlpkg/tlperl/lib/Safe.pm +++ b/Master/tlpkg/tlperl/lib/Safe.pm @@ -2,9 +2,9 @@ package Safe; use 5.003_11; use strict; -use Scalar::Util qw(reftype); +use Scalar::Util qw(reftype refaddr); -$Safe::VERSION = "2.27"; +$Safe::VERSION = "2.29"; # *** Don't declare any lexicals above this point *** # @@ -134,6 +134,7 @@ my $default_share = [qw[ &version::vxs::stringify &version::vxs::new &version::vxs::parse + &version::vxs::VCMP ]), ($] >= 5.011 && qw[ &re::regexp_pattern ])]; @@ -362,10 +363,12 @@ sub reval { return (wantarray) ? @subret : $subret[0]; } +my %OID; sub wrap_code_refs_within { my $obj = shift; + %OID = (); $obj->_find_code_refs('wrap_code_ref', @_); } @@ -377,6 +380,10 @@ sub _find_code_refs { for my $item (@_) { my $reftype = $item && reftype $item or next; + + # skip references already seen + next if ++$OID{refaddr $item} > 1; + if ($reftype eq 'ARRAY') { $obj->_find_code_refs($visitor, @$item); } |