c:\@Work\Perl\monks>perl -wMstrict -le "print qq{perl version: $] \n}; ;; use constant { STUFF => { 'bizz' => 'foe', 'bazz' => 'fie', 'bozz' => 'fee', 'buzz' => 'wiz', }, }; ;; my $obj = Kid->new; ;; my $n = 0; ;; METAMETHOD: for my $meta_method (qw/bizz buzz bazz zotz bozz/) { if (not exists STUFF->{$meta_method}) { print qq{no method corresponds to '$meta_method'}; next METAMETHOD; } ;; my $method = STUFF->{$meta_method}; ;; my $coderef = $obj->can($method); if (not $coderef) { print qq{cannot '$meta_method'->'$method' on }, ref $obj; next METAMETHOD; } $coderef->($obj, $method, $n++); } ;; { package Dad; ;; sub new { my $class = shift; return bless \my $x => $class; } sub fee { my $self = shift; $self->all(@_); } sub all { my $self = shift; print qq{method '$_[0]', n == $n}; } } ;; { package Kid; ;; use parent -norequire, qw(Dad); sub new { my $class = shift; return $class->SUPER::new; } sub fie { my $self = shift; $self->all(@_); } sub foe { my $self = shift; $self->all(@_); } } " perl version: 5.008009 method 'foe', n == 1 cannot 'buzz'->'wiz' on Kid method 'fie', n == 2 no method corresponds to 'zotz' method 'fee', n == 3