in reply to Question about creating intelligent behaviors in modules WRT external objects/modules

Query your object to see if it provides the necessary API. If so, use it. If not, try the fallback. If that doesn't exist, bitch at the user.

sub fulfills_interface_foo { my $self = shift; return $self->can( ... ) and $self->can( ... ) and $self->can( ... ) and $self->can( ... ); }

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

  • Comment on Re: Question about creating intelligent behaviors in modules WRT external objects/modules
  • Download Code