-
March 18th, 2008, 09:41 AM #1Junior Member
- Join Date
- Mar 2008
- Posts
- 2
Return code from .exe to cygwin perl
I'm in a perl script trying to get a return code from an .exe in cygwin.
All I can get is an 8bit return code (-128) --> (127) [a signed byte].
Perl gets the return code back through the special variable "$?" which
is 16bits but gets shifted 8bits (>>8) to retrieve the return code.
Is there a way that anyone knows of that I can get a larger return code (ie. a short 16bit or a long 32bit)?
This perl script is a converted batch program that used %ERRORLEVEL%.
Apparently it could return values greater than 8 bits.
Any help is greatly appreciated!
-
March 18th, 2008, 05:35 PM #2Junior Member
- Join Date
- Mar 2008
- Posts
- 2
Solved - Used a Wrapper Cmd File
Caller.pl --> Wrapper.cmd --> hello.exe
hello.exe returns the input parameter.
Wrapper.cmd
----------------------
@%1 %2 %3 %4 %5 %6 %7 %8 %9
@echo %ERRORLEVEL%
Caller.pl
-----------------
#!/usr/bin/perl
my $code = 'c:/executables/hello.exe';
my @out = `./Wrapper.cmd "$code" 1234`;
my $rc = pop @out;
print " return code = $rc\n";
print "\nThe Program Output Follows Here:\n";
print join '',@out;;
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
i386\ntkrnlmp.exe error code is 4
By LizP in forum Applications and Operating SystemsReplies: 5Last Post: February 7th, 2012, 05:04 PM -
Bad Return Code Errors. HELP computer if freezing during a game I play
By melomo65 in forum Technical SupportReplies: 0Last Post: March 2nd, 2004, 11:24 AM -
can cygwin replace explorer.exe?
By e980238 in forum Applications and Operating SystemsReplies: 3Last Post: July 25th, 2003, 02:09 PM -
Cygwin/Mingw problem
By Jüš† ä gü¥ in forum Webmastering and ProgrammingReplies: 3Last Post: November 23rd, 2002, 06:21 PM -
COde of PERL for URL hide
By frankbarlake in forum Webmastering and ProgrammingReplies: 0Last Post: November 19th, 2002, 12:08 AM



LinkBack URL
About LinkBacks



Reply With Quote

Those who say that higher corporate taxes will cause higher prices are wrong. The laws of economics state that producers already charge as much as the market will bare to yield them the highest...
Who Pays Corporate Income Taxes ?