Unfortunately you can't create a reference an object methodLuckily this turns out not to be the case. can returns a reference to the method you're looking for, and undef if that method doesn't exist, so you can write code like:
if that floats your boat. Just remember that what's returned is a regular sub ref, so you need to pass in the object or class name as the first parameter.my $ref = $obj->can($meth_name); $ref->($obj, @params);
In reply to Re: Re: Referencing methods
by Elian
in thread Referencing methods
by PetaMem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |