perl program to handle return of batch file -


I am trying to run a barrel file with a Perl script but I was able to handle the return of a batch file I'm not. Below is my code

perl script:

  // Call a batch file My $ output = system ('D: \\ WORKSPACE \\ CC_Triggers \\ batch_file.bat "); // Check the status of the batch file based on the output ($ output == 0) {print" Success in the trigger "***** ***** ";} and {print" FAILURE ********** ";}  

Batch File:

  set "java_output =" Settle Lock enabled delimited expense // This will call a Java program and get the return value For R. / f "delims =" %% ("java-cp" PMDFileRed.Jar; jxl.jar "PMD FileRed ') (set" java_output =! Java_output! %% J ") for Endlocal & amp; Set Java_output =% java_output% // and check Java's output and work accordingly IF% java_output% == 1 (echo fails to exit (1);) else (resonance is successful)  

Originally I am trying to validate an XLS file and returning the flag from the Java code which is being called from the batch file and again I need to return to the Perl script which I I can not find In case of success and failure, I am getting the output as "0" in the form of which the production is successful. Please request to correct my code or tell me the best way to handle it. Edit: Sorry, I somehow read before commenting by pointing out the same thing by MPPCPC.

The Pearl part is fine. If you always get a 0 , then it should be for batch scripts to be adopted. Or if you want to observe the return value in Perl, except that it is zero or not, then you have to convert it to the right 8 bits.

  $ my output = (system ("D: \\ WORKSPACE \\ CC_Triggers \\ batch_file.bat")))) & Gt; 8;  

But as you examine zero or not, it should not be an issue here.

EDIT: When using Windows, it is important to never define the environment variable ERRORLEVEL because it will be combined with the actual exit code returned by the applications. It has been explained in more detail:


Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -