diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm b/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm index 7839c6dc5cb..957ac278adc 100644 --- a/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm +++ b/Master/tlpkg/tlperl/lib/Archive/Tar/Constant.pm @@ -3,14 +3,13 @@ package Archive::Tar::Constant; BEGIN { require Exporter; - $VERSION = '1.90'; + $VERSION = '1.96'; @ISA = qw[Exporter]; require Time::Local if $^O eq "MacOS"; } -use Package::Constants; -@EXPORT = Package::Constants->list( __PACKAGE__ ); +@EXPORT = Archive::Tar::Constant->_list_consts( __PACKAGE__ ); use constant FILE => 0; use constant HARDLINK => 1; @@ -83,4 +82,29 @@ use constant CAN_READLINK => ($^O ne 'MSWin32' and $^O !~ /RISC(?:[ _])?OS/i a use constant ON_UNIX => ($^O ne 'MSWin32' and $^O ne 'MacOS' and $^O ne 'VMS'); use constant ON_VMS => $^O eq 'VMS'; +sub _list_consts { + my $class = shift; + my $pkg = shift; + return unless defined $pkg; # some joker might use '0' as a pkg... + + my @rv; + { no strict 'refs'; + my $stash = $pkg . '::'; + + for my $name (sort keys %$stash ) { + + ### is it a subentry? + my $sub = $pkg->can( $name ); + next unless defined $sub; + + next unless defined prototype($sub) and + not length prototype($sub); + + push @rv, $name; + } + } + + return sort @rv; +} + 1; |