I'm trying to execute a series of perl scripts that are in a Batch file. I want an admin person to be able click a hyperlink in an HTML page and the act of clicking the hyperlink to run the batch file with the multiple perl scripts in it. To try and do this I've written a Perl script that can be called from a hyperlink in an HTML page. This is the piece of HTML:
<a href="runindex.pl">Re-write the Indexes</a> (note this can be run at any time of day)<br>
(The page loads up fine) This is the perl script 'runindex.pl':
use strict; my $program="index.bat"; #$status= system $program or die "$program exited funny: $?";
This 'runindex.pl' runs fine from the dos command line, but when I try and run the script by clicking on the hyperlink I get this error:
CGI Error The specified CGI application misbehaved by not returning a complete s +et of HTTP headers. The headers it did return are: The name specified is not recognized as an internal or external command, operable program or batch file.
I get the distinct feeling that I'm missing something obvious, but I've been looking for an answer all day and have come up with diddly squat. I've tried both exec and system but got no more results with either of them. I'm plumping for system as I don't need to send arguments or get results back. Any help would be greatly appreciated

In reply to Am I missing something major here (system/exec)? by kjg

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.