Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^3: usage of $? in windows

by rovf (Priest)
on Mar 05, 2010 at 10:11 UTC ( [id://826933]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://826933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-20 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found