in reply to Re^3: Am I evil for doing this?
in thread Am I evil for doing this?
I prefer to not do the method-lookup twice and use the code reference returned by can:
$self->$code(...) where $code is a subroutine reference is equivalent to $code->($self, ...); you can even do []->$code or undef()->$code if you want.if (my $code = $self->can($method)) { $self->$code(...); }
ihb
See perltoc if you don't know which perldoc to read!
|
|---|