If there are no errors, the script invokes the commit_configuration method (defined in the file lib/JUNOS/Methods.pm in the JUNOScript Perl distribution):
print "Committing configuration from $xmlfile ...\n";
$res = $jnx->commit_configuration(????);
$err = $res->getFirstError(????);
if ($err) {
print "ERROR: Failed to commit configuration. Reason: $err->{message}.\n";
graceful_shutdown($jnx, $xmlfile, STATE_CONFIG_LOADED, REPORT_FAILURE);
}