What you want to do ("I run a system command with perl by pressing a button on browser") is called a CGI script. You need

  1. a program called a webserver on the machine where the command is to be executed. Example: apache
  2. the perl interpreter installed on the machine where the command is to be executed

when writing the perl script you have to know that:

  1. the script can not take normal input from STDIN, use (the module) CGI instead
  2. the script can write output to stdout, but the first thing you print out has to be "Content-Type: text/plain\n\n" (the line breaks at the end are very important)
  3. there are also some complications with file permissions and users (if we are talking about UNIX here), because the script will be run under the privileges of the webserver, not under your privileges.

I hope that helps in getting you started.

--
Brigitte    'I never met a chocolate I didnt like'    Jellinek
http://www.horus.com/~bjelli/         http://perlwelt.horus.at

In reply to Re: How can I run ? by bjelli
in thread How can I run ? by Anonymous Monk

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.