spikkie has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks, this question is regarding the special variable $? Is there a known portability issue between Perl and Windows related to + $? When I use the following piece of code #--------------------------------------------- my $cmd = "$search_application something"; my $ret = qx($search_application); unless ( $? == 0 ) { print "value \$? : $?\n"; die "Something not found\n"; } #--------------------------------------------- on Unix the $? has value 256 which is correct. But on windows $? stays 0 which I can not explain. When I run the command in a shell both unix and windows shell variable +s $? and %ERRORLEVEL% are "1" so the application is not the problem. Thanx in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: usage of $? in windows
by rovf (Priest) on Mar 04, 2010 at 12:15 UTC | |
by spikkie (Novice) on Mar 04, 2010 at 23:18 UTC | |
by ikegami (Patriarch) on Mar 04, 2010 at 23:32 UTC | |
by rovf (Priest) on Mar 05, 2010 at 10:11 UTC | |
by spikkie (Novice) on Mar 05, 2010 at 15:20 UTC |