my $object = Product::create( $data_ref ); if ($object->isa('Product::Real')) { &call_real_product_api( $object ); } else { &call_potential_product_api( $object ); }