Skip to content

Commit

Permalink
misc - add a dumper script
Browse files Browse the repository at this point in the history
  • Loading branch information
fglock committed Nov 9, 2014
1 parent a1320b0 commit 74adb31
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions misc/typeglob/dumper.pl
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,16 @@
{
no strict 'refs';

foreach my $entry ( keys %main:: ) {
print "$entry\n";
print "\tscalar is defined\n" if defined ${$entry};
print "\tarray is defined\n" if defined @{$entry};
print "\thash is defined\n" if defined %{$entry};
print "\tsub is defined\n" if defined &{$entry};
}
print Dump( \*Exporter );
my %out;

foreach my $entry ( keys %Exporter:: ) {
print "$entry ", Dump($Exporter::{$entry}), "\n";
print "\tscalar is defined\n" if defined ${$entry};
print "\tarray is defined\n" if defined @{$entry};
print "\thash is defined\n" if defined %{$entry};
print "\tsub is defined\n" if defined &{$entry};
# foreach my $entry ( keys %main:: ) {
local *g = $Exporter::{$entry};
if ( defined *g{SCALAR} ) { $out{$entry}{SCALAR} = *g{SCALAR} }
if ( defined *g{ARRAY} ) { $out{$entry}{ARRAY} = *g{ARRAY} }
if ( defined *g{HASH} ) { $out{$entry}{HASH} = *g{HASH} }
if ( defined *g{CODE} ) { $out{$entry}{CODE} = *g{CODE} }
}
print Dump( \%out ), "\n";
}

my $v = {
v => 1,
d => \&Dump,
};

print Dump($v);

0 comments on commit 74adb31

Please sign in to comment.