home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

Return code from .exe to cygwin perl

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2614
Discussions: 200,962, Posts: 2,379,583, Members: 246,330
Old March 18th, 2008, 10:41 AM   Digg it!   #1 (permalink)
Junior 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!
jimcadd is offline   Reply With Quote
Old March 18th, 2008, 06:35 PM     #2 (permalink)
Junior Member
 
Join Date: Mar 2008
Posts: 2
Talking
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;;
jimcadd is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
i386\ntkrnlmp.exe error code is 4 LizP Applications and Operating Systems 2 April 9th, 2007 10:49 AM
Bad Return Code Errors. HELP computer if freezing during a game I play melomo65 Technical Support 0 March 2nd, 2004 11:24 AM
can cygwin replace explorer.exe? e980238 Applications and Operating Systems 3 July 25th, 2003 03:09 PM
Cygwin/Mingw problem Jüš† ä gü¥ Webmastering and Programming 3 November 23rd, 2002 06:21 PM
COde of PERL for URL hide frankbarlake Webmastering and Programming 0 November 19th, 2002 12:08 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Is It Just Me? (2983)
The disrespect of Obama by Russian .. (46)
Making Health Care Worse (181)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
Laptop with wireless problem. (7)
Regular Build (11)
windows 7 problem (7)
Point and Shoot Camera Suggestions. (6)
windows vista security holes (14)
Is the PSU I received dead? (13)
Print spooler problem (16)
radeon x850xt platinum & shader.. (6)
HIS HD5770 graphic card question (15)
Recent Discussions
windows vista security holes (14)
Laptop with wireless problem. (7)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Nvidia GTX 260 problem (1)
Modern Warfare 2: Who Bought It? (65)
Is the PSU I received dead? (13)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)
Multiple Restarts Required at Boot (3)
Open With ..... Win7 (1)
webcam (0)
upgrade for hp a6101 (0)
tv not turn on-makes clicking sound (2)
EVGA 9800 gtx help with finding a goo.. (11)
Regular Build (11)
Help with onclick and buttons (0)
Virus advise (8)
My monitor won't turn on after instal.. (1)
Internet Lost (3)
Dept. of HS: NSA 'Helped' Develop Vis.. (16)
Ideal cheap graph card for PC-Gaming? (18)
radeon x850xt platinum & shader 3 (6)
Graphics Card Upgrade Question (4)
For Sale BFG GTX285 OC2 with 10 year .. (3)


All times are GMT -4. The time now is 12:28 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28