Loading ...
Sorry, an error occurred while loading the content.

Problem with return code

Expand Messages
  • pascalinebestry
    Hello, I have a .bat program with a part in perl. The problem is that I want to retreive an error message from the part in perl to create a file KO or OK in
    Message 1 of 3 , Sep 26, 2003
    • 0 Attachment
      Hello,

      I have a .bat program with a part in perl.

      The problem is that I want to retreive an error message from the part
      in perl to create a file KO or OK in result

      #!perl

      perl code

      __END__
      :endofperl

      if not %RETURNCODE% == 0 goto FIN_KO;
      This line is not working!!!

      call %PERLDIR%\writeRetour.bat I013prequery0e D
      goto FIN

      :FIN_KO
      call %PERLDIR%\writeRetour.bat I013prequery0e E

      :FIN

      Has someone got an idea ???

      Thanks

      Pascaline Bestry
    • Damien Carbery
      ... Could you move the code you list into the perl section (and porting it to perl obviously)? You could use system() to run the other batch file. This
      Message 2 of 3 , Sep 26, 2003
      • 0 Attachment
        --- In perl-beginner@yahoogroups.com, "pascalinebestry"
        <pascaline.bestry@l...> wrote:
        > Hello,
        >
        > I have a .bat program with a part in perl.
        >
        > The problem is that I want to retreive an error message from the part
        > in perl to create a file KO or OK in result
        >
        > #!perl
        >
        > perl code
        >
        > __END__
        > :endofperl
        >
        > if not %RETURNCODE% == 0 goto FIN_KO;
        > This line is not working!!!
        >
        > call %PERLDIR%\writeRetour.bat I013prequery0e D
        > goto FIN
        >
        > :FIN_KO
        > call %PERLDIR%\writeRetour.bat I013prequery0e E
        >
        > :FIN
        >
        > Has someone got an idea ???
        >
        > Thanks
        >
        > Pascaline Bestry

        Could you move the code you list into the perl section (and porting it
        to perl obviously)?
        You could use 'system()' to run the other batch file.

        This method would mean you don't have to worry about interfacing
        between the perl portion and the bat portion.
      Your message has been successfully submitted and would be delivered to recipients shortly.