if( ! eval { $count = $obj->GetCount(); 1 } ) { # Can determine count }