From 9b608466b5fdd9e91e34e050eb9ca861e36aa71d Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 12 Nov 2010 04:09:54 -0600 Subject: implement list_all_package_symbols --- lib/Package/Stash.pm | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'lib') diff --git a/lib/Package/Stash.pm b/lib/Package/Stash.pm index 59b2c29..a984a96 100644 --- a/lib/Package/Stash.pm +++ b/lib/Package/Stash.pm @@ -359,39 +359,6 @@ etc). Note that if the package contained any C blocks, perl will leave an empty typeglob in the C slot, so this will show up if no filter is used (and similarly for C, C, etc). -=cut - -sub list_all_package_symbols { - my ($self, $type_filter) = @_; - - my $namespace = $self->namespace; - return keys %{$namespace} unless defined $type_filter; - - # NOTE: - # or we can filter based on - # type (SCALAR|ARRAY|HASH|CODE) - if ($type_filter eq 'CODE') { - return grep { - # any non-typeglob in the symbol table is a constant or stub - ref(\$namespace->{$_}) ne 'GLOB' - # regular subs are stored in the CODE slot of the typeglob - || defined(*{$namespace->{$_}}{CODE}) - } keys %{$namespace}; - } - elsif ($type_filter eq 'SCALAR') { - return grep { - ref(\$namespace->{$_}) eq 'GLOB' - && defined(${*{$namespace->{$_}}{'SCALAR'}}) - } keys %{$namespace}; - } - else { - return grep { - ref(\$namespace->{$_}) eq 'GLOB' - && defined(*{$namespace->{$_}}{$type_filter}) - } keys %{$namespace}; - } -} - =head1 BUGS No known bugs. -- cgit v1.2.3-54-g00ecf