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.


In reply to executing a program by me1

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.