Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: tracing SUPER

by lachoy (Parson)
on Jul 28, 2004 at 20:26 UTC ( #378201=note: print w/replies, xml ) Need Help??


in reply to tracing SUPER

Class::ISA might be useful in this case -- you can just ask each class if it supports 'validate()' and if so print that out, like this untested:

sub validate { my $self = shift; # do validation foreach my $parent_class ( Class::ISA::super_path( ref $self ) ) { if ( $parent_class->can( 'validate' ) ) { print "Will call '$parent_class->validate()'\n"; last; } } return $self->SUPER::validate(@_); }

Chris
M-x auto-bs-mode

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://378201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2016-09-27 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (496 votes). Check out past polls.