### Installing the multi-method hook. *$method_name = sub { my ($self) = shift; if (wantarray) { return map $self->$_(@_), @$methods_to_call; } elsif ( defined wantarray ) { return join( ' ', map $_->$_(@_), @$methods_to_call ); } else { $self->$_(@_) for @$methods_to_call; return; } }; ### Installing the multi-method hook. eval 'sub $method_name { my ($self) = shift; my @results; if (wantarray) { ' . join( '', map "#line $_->{line} \"$_->{filename}\" push \@results, \$self->\$methods_to_call[$_->{index}]( \@_ ); " ) . '#line ' . __LINE__ . ' "' . __FILE__ . '" return @results; } elsif ( defined wantarray ) { ' . join( '', map "#line $_->{line} \"$_->{filename}\" push \@results, \$self->\$methods_to_call[$_->{index}]( \@_ ); " ) . '#line ' . __LINE__ . ' "' . __FILE__ .'" return join( " ", @results ); } else { ' . join( '', map "#line $_->{line} \"$_->{filename}\" \$self->\$methods_to_call[$_->{index}]( \@_ ); " ) . '#line ' . __LINE__ . ' "' . __FILE__ .'" return join( " ", @results ); } }';