As a variation on ysth's suggestion, you could require that the mocking class implement the 'mocks' method:
ref($obj) eq 'OP' || $obj->can('mocks') && $obj->mocks('OP')Of course, if 'mocks' it handled through AUTOLOAD, this will fail.
In reply to Re^5: ISA but no farther?
by jhourcle
in thread ISA but no farther?
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |