On the error checking front, you may want to throw can into the mix, so methodname is only called if the object implements it.
sub MultiMethod { my $method = shift; my $args = shift; foreach my $object (@_) { $object->$method(@$args) if $object->can($method); } }
--k.
In reply to Re: Method Calls on multiple objects
by Kanji
in thread Method Calls on multiple objects
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |