473,480 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Executables?

Hi All!

I'm a newbie to perl. I've written a small cgi script that runs as
the consequence of a form with radio buttons.

After the button is clicked, an exe is to run. How much ever i try, i
cant get that to happen. I hear a "ding" sound which is indicative os
some error.. I can run the perl script in command line using perl
getdata.cgi. I have win98, IE6. Here's the code :-
#!c:\perl\bin\perl.exe

if ($ENV{'REQUEST_METHOD'} eq 'POST')
{

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

@pairs = split(/&/, $buffer);

foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$form{$name}=$value;
}
}

system "front.exe";
if($form{'R1'} eq 'V1')
{
open(a,"Parta.txt");
$stockA=<a>;
close(a);
print"Content-type:text/html\n\n";
print"<html><title></title><body>";
print"<body text=\"\#FFFFFF\" bgcolor=\"#000000\">";
print"\n&nbsp;&nbsp;&nbsp;<p align=\"center\"> <font size=\"5\"
color=\"\#FFFFFF\">The number of part A components in the warehouse is
: </font><font size=\"5\" color=\"\#FF6600\">$stockA</font></p>";
}

......and so on....

Where have i gone wrong? Any help will be appreciated..

Regards,
Devyn
Jul 19 '05 #1
3 1823
Devyn wrote:
After the button is clicked, an exe is to run. How much ever i try,
i cant get that to happen. I hear a "ding" sound which is
indicative os some error.. I can run the perl script in command
line using perl getdata.cgi.


Try stating the full path to the .exe file:

system('C:/somepath/front.exe') == 0
or die "executing front.exe failed: $?";

See also

perldoc -f system

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #2
Gunnar Hjalmarsson <no*****@gunnar.cc> wrote in message news:<pn********************@newsb.telia.net>...

Try stating the full path to the .exe file:

system('C:/somepath/front.exe') == 0
or die "executing front.exe failed: $?";


Hi!
Thanx for the reply. I tried including this in my program, but it
didnt work. Let me give out a few more details.

The cgi-script is in the same drectory as the front.exe Front.exe uses
the parallel port (i'm usin win98..)and generates 3 txts. The script,
which continues to run, reads these txts based on the decision made in
the radio button form and displays a message.

I still get that ding sound when i run the script from the browser i.e
clicking on the button in the form. However "perl getdata.cgi" in the
command prompt works smoothly. Where am i going wrong?

Devyn
Jul 19 '05 #3
Devyn wrote:
[...]
I still get that ding sound when i run the script from the browser i.e
clicking on the button in the form. However "perl getdata.cgi" in the
command prompt works smoothly. Where am i going wrong?


Please see "perldoc -q 500"

jue
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
11647
by: Hemanth | last post by:
Hello there, I'm new to PHP. I'm trying to run a simple php script (on a Red hat linux machine with apache web server ) through a windows web browser (IE). I'm using an exec() function in my...
2
2195
by: Jubril Oyesiji | last post by:
Does anyone have an idea about how to convert Java Class files into Windows Executables (.Exe) except writing a Batch file
9
1397
by: mac | last post by:
when a c program is compiled using 'gcc test.c' 'cannot create c executables is thrown' I cannot able to figure out the problem could anyone help me. Thanks.
20
6139
by: | last post by:
Back in the Old days, I compile a C++ executable, copy the dll's used by this executable to the same folder. Go to another computer, copy that folder locally, double click on the exe file and off...
2
1821
by: ven | last post by:
I have used C# binary formatter to serialize and deserialize a data structure. However, for the same data format( used by the first executable, the same *.CS files), the second executable gives an...
5
1401
by: VJ | last post by:
I have one VB.NET project, that outputs a "Mycomapny.exe" everytime I do a build. But I need it to output 4 different executables everytime I build. How do I archive this. I am looking at the...
1
1710
by: Water Cooler v2 | last post by:
I have a Windows Service I am writing in C# and a set of, let us say three, other executables written in C# (mostly console applications). I want that the Windows Service must do so every few...
0
992
by: A W | last post by:
Hello, I am encountering the following scenario while compiling a project under Visual Studio 2005 with the floating point model set as precise. Two executables A and B share a common dll C. ...
4
5226
by: ravit | last post by:
I have built my gdb-6.7.1 yesterday on my AIX 5.3 64 bit machine. my gcc is gcc3.3.2 and tried debugging 64 bit executables generated by gcc, working fine. debugging session ends successfully....
6
1642
by: =?Utf-8?B?Q2hhcmxlcyBS?= | last post by:
I have two different executables that I want to build w/ the same source but in 2 different compilers, vs60 and vs2008. I have 2 different configurations w/ different options etc, but I want one...
0
7037
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6904
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5321
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.