int *x; if(ptr != NULL && *ptr==5){ ... } if( objPtr != NULL && objPtr->foo() ){ ... } # extended to perl: my $obj = Foo::Bar->new(); if( $obj && $obj->blah() ){ ... }