in reply to Re^2: tracing SUPER
in thread tracing SUPER

It's not that complicated. The "Perl Cookbook" says:

Note that SUPER only works on the first overridden method. If your @ISA array has several classes, it only gets the first one.

Replies are listed 'Best First'.
Re^4: tracing SUPER
by gaal (Parson) on Jul 28, 2004 at 18:34 UTC
    This sounds fishy to me! Could it be that the Cookbook means that SUPER stops at the first match?

    I had to test, and it appears to be the case:

    #!/usr/bin/perl -w package A; sub new { bless {}, shift } package B; sub new { bless {}, shift } sub blarf { print "B::blarf\n" } package C; @ISA = qw/A B/; sub blarf { my($self) = @_; print "C::blarf\n"; $self->SUPER::blarf; } package main; C->new->blarf; __END__ % perl ~/super.pl C::blarf B::blarf