me1 has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I have this code which I am using to try and run the program called a1, but it does not seem to be working. Does anyone know how to run programs using perl or cgi or use command line language in perl or cgi. Thanks!
#!/usr/bin/perl -w use CGI; $query = new CGI; # Tell perl to send a html header. # So your browser gets the output # rather then <stdout>(command line # on the server.) print "Content-type: text/html\n\n"; # print your basic html tags. # and the content of them. print "<html><head><title>Hello World!! </title>"; print "</head>\n"; print "<body><h1>Hello world</h1>"; print "</body>"; print "</html>\n"; my $prgm = system ('ssh root\@1\.1\.1\.1\executable1\a1'); if ($? == -1) { print "Command Failed: $!\n"; } else { print "Command exited with value %d", $? >>8; } print $prgm;
PS: The name of the folder is supposed to be executable1 and the a1 is the actual executable program.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: executing a program
by choroba (Cardinal) on Jul 12, 2011 at 11:46 UTC | |
|
Re: executing a program
by amcglinchy (Novice) on Jul 12, 2011 at 17:06 UTC | |
|
Re: executing a program
by i5513 (Pilgrim) on Jul 12, 2011 at 14:27 UTC |