Help for this page

Select Code to Download


  1. or download this
    sub foo
    {
      my ($self) = @_;
      croak "..." unless ref($self) && $self->isa("AnInterface")
    }
    
  2. or download this
    sub foo # requires interfaces InterfaceA, InterfaceB
    {
    ...
      InterfaceA::validate($self);
      InterfaceB::validate($self);
    }
    
  3. or download this
    sub InterfaceA::validate
    {
    ...
      error unless $candidate->can("fn1"); # implicit ISA
      error unless $candidate->can("fn2");
    }
    
  4. or download this
    sub validate_object
    {
    ...
      my ($self) = @_;
      validate_object($self, map {"Interface$_"} qw/A B D/);
    }