Perl Monk, Perl Meditation | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi pjf,
That's a good question, and I'll be interested to see what the Win32 experts can come up with. As regards the suppression of the error message, one could just redirect stderr to the null device (which you do with 2>nul on Windows) ... but you probably knew about that, anyway. Other than that, all I can think of is to use Win32::Process instead of system(). If the "system" call launched by Win32::Process::Create() fails (in which case it returns 0) you can access good diagnostics via Win32::FormatMessage((Win32::GetLastError()). And if it succeeds, then you can get the exitcode of the process that was launched with $ProcessObj->GetExitCode($exitcode). Cheers, Rob In reply to Re: $? set to strange values on failure under Win32
by syphilis
|
|