if($test) { print LOG "The test was successful, now invoking \$obj->method()."; $obj->method(); } else { print LOG "The test was unsuccessful, so we won't invoke the \$obj->method()."; }