Skip to content

Instantly share code, notes, and snippets.

@exodist
Created December 15, 2015 21:43
Show Gist options
  • Save exodist/bcf3a7bec3631e4995c5 to your computer and use it in GitHub Desktop.
Save exodist/bcf3a7bec3631e4995c5 to your computer and use it in GitHub Desktop.
sub _get_all_attrs {
my @todo = @_;
my %seen;
my @all;
while (my $pkg = shift @todo) {
next if $seen{$pkg}++;
my $found = $META{$pkg};
push @all => @$found if $found;
no strict 'refs';
my $isa = \@{"$pkg\::ISA"};
push @todo => @$isa if @$isa;
}
return \@all;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment