diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2022-03-14 10:08:50 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2022-03-14 10:08:50 +0000 |
commit | 49b9d8ffc05bf0c271287eb1390cabad28c6a47a (patch) | |
tree | e2e1779b1d4795d6b2c3bf92a4e2e4154d82124b /Master/tlpkg/tlperl/lib/Symbol.pm | |
parent | f03a75ebd3b935ecde4dde32687fbe86161c30ed (diff) |
New tlperl 5.34
git-svn-id: svn://tug.org/texlive/trunk@62701 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Symbol.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Symbol.pm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/Master/tlpkg/tlperl/lib/Symbol.pm b/Master/tlpkg/tlperl/lib/Symbol.pm index 0e8d67fffd9..0ae79a22743 100644 --- a/Master/tlpkg/tlperl/lib/Symbol.pm +++ b/Master/tlpkg/tlperl/lib/Symbol.pm @@ -1,5 +1,8 @@ package Symbol; +use strict; +use warnings; + =head1 NAME Symbol - manipulate Perl symbols and their names @@ -78,14 +81,12 @@ you reload the C<Foo> module afterwards. =cut -BEGIN { require 5.005; } - require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(gensym ungensym qualify qualify_to_ref); -@EXPORT_OK = qw(delete_package geniosym); +our @ISA = qw(Exporter); +our @EXPORT = qw(gensym ungensym qualify qualify_to_ref); +our @EXPORT_OK = qw(delete_package geniosym); -$VERSION = '1.08'; +our $VERSION = '1.09'; my $genpkg = "Symbol::"; my $genseq = 0; @@ -99,6 +100,7 @@ my %global = map {$_ => 1} qw(ARGV ARGVOUT ENV INC SIG STDERR STDIN STDOUT); # sub gensym () { my $name = "GEN" . $genseq++; + no strict 'refs'; my $ref = \*{$genpkg . $name}; delete $$genpkg{$name}; $ref; @@ -132,6 +134,7 @@ sub qualify ($;$) { } sub qualify_to_ref ($;$) { + no strict 'refs'; return \*{ qualify $_[0], @_ > 1 ? $_[1] : caller }; } @@ -150,6 +153,7 @@ sub delete_package ($) { } my($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/; + no strict 'refs'; my $stem_symtab = *{$stem}{HASH}; return unless defined $stem_symtab and exists $stem_symtab->{$leaf}; @@ -160,6 +164,7 @@ sub delete_package ($) { foreach my $name (keys %$leaf_symtab) { undef *{$pkg . $name}; } + use strict 'refs'; # delete the symbol table |