Monks. I've created an html page and I'd like to have it run a previously created perl script at the click of a button. While I've got that working, I can't seem to be able to pass the options:

HTML SNIPPET: (This fails only when I pass options i.e. -a -s...)
</form><form action="http://XXX/XXX/XXX/add-hosttest.pl -s server -u u +sername -p password -v view -n name -a ip address" method="post"> <input type="submit" name="sub" value="Run this!"> </form>
PERL SNIPPET: (Shows the GET Options layout)

GetOptions(
"s|server=s" => \$appliance,
"u|username=s" => \$username,
"v|view=s" => \$dnsview,
"n|name=s" => \$fqdn,
"a|address=s" => \$address,
"h|help" => sub { usage("\nTry: $NAME -s IP
-u user -p passwd -v DNSview -n FQDN -a address \n") }, );

When I click on this event, I get a "Page not found" Error message. However, when I run the script without the options and define them in the perl script itself, it works fine...

HTML SNIPPET: (Works just fine)
</form><form action="http://XXX/XXX/XXX/add-hosttest.pl" method="post" +> <input type="submit" name="sub" value="Run this!"> </form>

Perl Snippet: (variables defined) - (Works just fine)

$appliance = 'server';
$username = 'username';
$password = 'password';
$dnsview = 'view';
$fqdn = 'name';
$address = 'X.X.X.X';

Can anyone explain how I can run the Perl script with the options from the html page. Because I'm defining variables there, I'd like to pass them when running the perl script. Any help would be greatly appreciated. Thanks.

In reply to running a Perl script with options via HTML by tronmason

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.