Help for this page

Select Code to Download


  1. or download this
    *isa=*UNIVERSAL::isa;
    
    ...
      elsif (isa($foo,'Type2')) { return $foo->method2 }
      else { return $foo->method3 }
    }
    
  2. or download this
    sub Type1::generic_method { $_[0]->method1 }
    sub Type2::generic_method { $_[0]->method2 }
    ...
      ...
      return $foo->generic_method
    }