sub wibble { my ($self, $obj) = @_; croak "Argument to wibble must be a 'foo' object" if ! ( blessed $obj and $obj->isa('foo') ); if ( $obj->wobble() eq 'spoon' ) { # handle spoon } }