Not too long ago i created this piece of code to try to help with some debugging. It should tell you the entire ancestor tree of your object. I dont think the order is exactly like the way that methods would be searched for, but i thought of this code when i first read your post.
Put this method in your Child class. (hopefully you'll be able to call it.)
sub isa_descent {
my $self = shift @_;
my ($class) = @_;
print "\npackage: $class\n";
no strict 'refs';
my @ancestors = @{ 'main::' . $class . '::ISA' };
use strict;
foreach my $ancestor ( @ancestors ) {
print "...ancestor: $ancestor\n";
$self->isa_descent($ancestor);
}
}
You'll want to call it from outside the class probably, perhaps just after creating the object instance. The output wont change unless you're messing with @ISA.
$o->isa_descent(ref $o);
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|