in reply to Re^2: usage of $? in windows
in thread usage of $? in windows

You mean: Why you get different exit codes? (In both cases, the *error* is 0, but on Unix you see exit code 1 and on Windows you see exit code 0). Could it be that on Windows, a shell is running between your perl program and the application, and this is "eating" the exit code of the application? Do you get the same effect if you bypass the shell?

Another thing to try is to replace your application by one where you can control the exit code directly. For instance when I execute (on Windows 2000) the program

use strict; use warnings; my $r=qx(set|perl -lwe "print <STDIN>; exit 1"); print "$?\n";
I get correct the exit code 1 (i.e. 256). What do you get in this case?

-- 
Ronald Fischer <ynnor@mm.st>

Replies are listed 'Best First'.
Re^4: usage of $? in windows
by spikkie (Novice) on Mar 05, 2010 at 15:20 UTC

    Hi Ronald, Hi Ikegami,

    thanx for helping solving the problem.

    Yes another shell was running in between which did not return with "exit %errorlevel%"

    really appreciated your help

    Kindest regards,

    Spikkie