I think what you want to do is this:

Create a CGI wrapper script around your "not a CGI script" script. Inside the wrapper, invoke the regular script using system(), or back ticks:

$status = `not_a_cgi.pl`;

Note that this is normally considered a bad idea (security risk, etc) - BUT, if you're only running on localhost, and no one else has access to your machine, and you have some way to guarantee that only you can see the control panel page (maybe a login page?) etc., etc. then it might be okay for what you want to do.

BUT - keep in mind that the script will run with the user id of the web server. For example, if you're running Apache it usually runs as user "apache", so any files you need to access from within your script must be readable/writable by "apache".

If this causes problems, you can modify the apache config file so that CGI scripts in your own CGI bin directory run with your user id instead (again, this is usually considered a bad idea, security risk, etc.) but may be okay for what you want.

I've done stuff like this before, but always within a company intranet, behind a firewall, for internal tools, used only by myself, etc. I'd never recommend something like this out in the wild.


In reply to Re^3: CGI "control panel" app by scorpio17
in thread CGI "control panel" app by mojodaddy

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.