944,156 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Marked Solved
  • Views: 3795
  • Perl RSS
May 11th, 2006
0

Executing Server Applications remotely

Expand Post »
Hello
I am new in Perl and CGI. I want to write a program in perl that enables me to call executables, some of them maybe GUI.
My starting point was to write a small program that would call an interface because this is on a local machine. Ultimately i want to send commands to execute applications from a client.
The program i wrote gives me this error
Can't spawn "cmd.exe": No such file or directory at C:/www/cgi-bin/compound.pl line 8. child exited with value 255. what do i do to make run all my applications?

The program is like <>[HTML]
my $mouse = ("start /maximised /Program Files/DHI/MOUSE2002/Bin/Syrakus.exe");##"C:\Program Files\DHI\MOUSE 2002\Bin\Syrakus.exe" MOUSE2002_80
system $mouse ;
if ($? == -1)
{ print "failed to execute: $!\n"; }
elsif ($? & 127)
{ printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; }
else
{ printf "child exited with value %d\n", $? >> 8; }
[/HTML]
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
brounemmanuel is offline Offline
7 posts
since May 2006
May 12th, 2006
0

Re: Executing Server Applications remotely

To run any system application with perl you use:

system()
backtiks: ` `
qx/ /
exec()

but exec exits the perl program. Whcih you use depends on what you are doing.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006
May 12th, 2006
0

Re: Executing Server Applications remotely

Am not sure that gives me the answer, it is like it either starts the application but nothing shows or because of the error it doesnt. I wanted to know how i can get the error solved and how i can run different applications remotely.
thanks



Quote originally posted by brounemmanuel ...
Hello
I am new in Perl and CGI. I want to write a program in perl that enables me to call executables, some of them maybe GUI.
My starting point was to write a small program that would call an interface because this is on a local machine. Ultimately i want to send commands to execute applications from a client.
The program i wrote gives me this error
Can't spawn "cmd.exe": No such file or directory at C:/www/cgi-bin/compound.pl line 8. child exited with value 255. what do i do to make run all my applications?

The program is like <>[html]
my $mouse = ("start /maximised /Program Files/DHI/MOUSE2002/Bin/Syrakus.exe");##"C:\Program Files\DHI\MOUSE 2002\Bin\Syrakus.exe" MOUSE2002_80
system $mouse ;
if ($? == -1)
{ print "failed to execute: $!\n"; }
elsif ($? & 127)
{ printf "child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; }
else
{ printf "child exited with value %d\n", $? >> 8; }
[/html]
Reputation Points: 10
Solved Threads: 0
Newbie Poster
brounemmanuel is offline Offline
7 posts
since May 2006
May 13th, 2006
0

Re: Executing Server Applications remotely

I believe the error codes are specific to the operating system, so you may have to try and determine what 255 means for your operating system, personally I don't know. Maybe someone else can shed some light on this problem for you.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006
May 14th, 2006
0

Re: Executing Server Applications remotely

Thank you Kevin,
I can run the application using the different methods, system,backticks and open on commandline. When i run a windowcomes up as expected and executes the comands it however doesnt work on internet even on same computer. The window should be able to come up on server and not affect the execution is it?
Please assist am stuck.
[HTML]
#@args = ("/Program Files/DHI/MOUSE 2002/Bin/mouse604.exe", '\MOUSE\Tutor1.mpr', "Ro", "Run", "Close", "NoPrompt","Minimize");
#@args1 =("/Program Files/DHI/MOUSE 2002/Bin/mouse604.exe", '\MOUSE\Tutor1.mpr', "HD" ,"Run", "Close", "NoPrompt","Minimize");
#system (@args)==0 or die "system failed at: $?";
#system (@args1)==0 or die "system failed at: $?";
$mouse = ("/www/cgi-bin/mouse.bat");
local *PIPE;
open (PIPE,"$mouse |")or die "Can not open pipe";
print while <PIPE>;
close PIPE;
#system $mouse ;
#@output=`@args`;
#@output=`@args1`;
[/HTML]
Reputation Points: 10
Solved Threads: 0
Newbie Poster
brounemmanuel is offline Offline
7 posts
since May 2006
May 14th, 2006
0

Re: Executing Server Applications remotely

You may want to post on another forum where there could be more members that have experience with this type of thing you are trying. Try perlmonks or devshed.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006
May 24th, 2006
0

Re: Executing Server Applications remotely

I relation to this subject i want to pass a parameter (Name) from a form and use it in subsequent execution execution of this perl program. how do i do that.
Is it possible to call a GUI remotely?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
brounemmanuel is offline Offline
7 posts
since May 2006
May 24th, 2006
0

Re: Executing Server Applications remotely

please start a new thread.
Reputation Points: 246
Solved Threads: 67
Practically a Posting Shark
KevinADC is offline Offline
898 posts
since Mar 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: perl in bioinformatics
Next Thread in Perl Forum Timeline: Form data as input into Perl code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC