title: Get all methods and/or properties in a given Perl class or module
body: <p>I'm dealing with an apparent simple issue.</p>
  
  <p>I'm writing a module similar to <a href="http://search.cpan.org/~agent/UML-Class-Simple-0.19/lib/UML/Class/Simple.pm" rel="nofollow noreferrer">UML::Class::Simple</a> but with some improvements. Summarizing, the idea is to retrieve a record card for each module in a given source, containing information about the Methods, Properties, Dependencies and Children. My current problem is getting Methods and Properties for each module. Let's see the code I've already written:</p>
  
  <pre><code>use Class::Inspector;
  use Data::Dumper;
  sub _load_methods{
    my $pkg = shift;
    my $methods = Class::Inspector-&gt;methods( $pkg, 'expanded' );
    print Dumper $methods;
    return 1;
  }
  </code></pre>
  
  <p>Calling this function for a given package, I get more methods than I expect. The reason is <a href="http://search.cpan.org/~adamk/Class-Inspector-1.28/lib/Class/Inspector.pm" rel="nofollow noreferrer">Class::Inspector</a> returns all inherited methods and also the accessors if the module is a Moose::Object. I would like to filter all of this methods to get just those defined in the given package, not in its parents.</p>
  
  <p>Can anyone provide an elegant way to filter the list of methods in the way I suggest?</p>
  
  <p>Thanks in advance.</p>