in reply to Re^2: $? set to strange values on failure under Win32
in thread $? set to strange values on failure under Win32
What results do you get on vista from this version?
#! perl -slw use strict; undef $^E; undef $!; print 'Successful command returning 1'; system 'c:/perl/bin/perl.exe -e"sleep 5; exit 1"'; print "![$!] ?[@{[$?, ':', $?>>8]}] E[$^E]"; undef $^E; undef $!; print "\nNonexistent command, attempted direct but fallback to via cmd +"; system 'c:/doesNotExists.exe'; print "![$!] ?[@{[$?, ':', $?>>8]}] E[$^E]"; undef $^E; undef $!; print "\nNonexistent via cmd because 'shell chars'; sending stderr >nu +ll"; system 'c:/doesNotExists.exe 2>null'; print "![$!] ?[@{[$?, ':', $?>>8]}] E[$^E]"; __END__ C:\test>junk Use of uninitialized value in undef operator at C:\test\junk.pl line 4 +. Successful command returning 1 ![] ?[256 : 1] E[] Use of uninitialized value in undef operator at C:\test\junk.pl line 1 +0. Nonexistent command, attempted direct but fallback to via cmd 'c:/doesNotExists.exe' is not recognized as an internal or external co +mmand, operable program or batch file. ![No such file or directory] ?[256 : 1] E[The system cannot find the f +ile specified] Use of uninitialized value in undef operator at C:\test\junk.pl line 1 +6. Nonexistent via cmd because 'shell chars'; sending stderr >null ![] ?[256 : 1] E[The system cannot find the file specified]
Aside: That Use of uninitialized value in undef operator ... wins the
BrowserUk Award with Special Commendation" in the category of "Most Useless Warning of theWeekMonthYearEver".
And that's in a highly contested category. :)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: $? set to strange values on failure under Win32
by syphilis (Archbishop) on Jul 07, 2007 at 11:56 UTC | |
by pjf (Curate) on Jul 08, 2007 at 00:03 UTC | |
by syphilis (Archbishop) on Jul 08, 2007 at 01:21 UTC | |
by pjf (Curate) on Jul 08, 2007 at 01:34 UTC |