"be consistent" | |
PerlMonks |
Re^5: $? set to strange values on failure under Win32by pjf (Curate) |
on Jul 08, 2007 at 00:03 UTC ( [id://625466]=note: print w/replies, xml ) | Need Help?? |
BrowserUk/Rob, your responses are gold. Your answers are exactly the sort of information I was after. However it appears that $^E isn't yet my saviour. Under my Windows XP system I get the following results (uninitalized warnings trimmed):
It appears that redirecting stderr makes an unsuccessful command appear to be a successful command. When an error does occur, it's found inside $! and not $^E, which seems to never be set. Oh my! Unfortunately this leaves me with the same tangle as Perl itself has in emulating system() under Windows. Ideally I want to preserve the following behaviours:
Using the shell means I don't have a reliable way of determining failure to start a command. Not using the shell means I may have to potentially go searching through $ENV{PATH} by hand. I guess this is an excellent opportunity for me to go searching for that discussion by tye, and potentially go looking through Perl's source for system() under Windows. I suspect my final result will make heavy use of Win32:: modules to provide the required behaviour. Many thanks again! Update: Working with Win32::Process is showing great promise.
Paul Fenwick Perl Training Australia
In Section
Seekers of Perl Wisdom
|
|