View Single Post
Old Dec 5th, 2005, 8:10 PM   #1
BaroN NighT
Programmer
 
Join Date: Mar 2005
Location: USA
Posts: 60
Rep Power: 4 BaroN NighT is on a distinguished road
Cant call c++ program in cgi script. HELP!

I'm trying to make a cgi script using perl to call a c++ program. I have all my programs in the same directory as the cgi script. This is part of the script that I have problem with:
if($pairs[2] eq "language=Cpp" && $pairs[3] eq "datatype=ID"){
 $pairs[3]=~/.+=(\w+)/;
 my $ID=$1;
 $pairs[4]=~/.+=(\d+)/;
 my $studentID=$1;
 @getC=`./main.exe $ID $studentID`; #this is where I think the program fails
}
I tried to run the web page without the last line and it works. So I'm pretty sure the last line where I call the C++ program is where the script fails. But I dont know why, isnt that the way how you call a c++ program from a cgi script? Thank you in advance for your help guys!
BaroN NighT is offline   Reply With Quote