Okay here's what I'm trying to do I have a set of CGI scripts that run a particular website, the boss wants to see stats on this website. My company uses an SSI based stat generating program that is absolutly ancient because rant: the brain-dead administrators think that a log-file based stats generator running at 3am is processor intensive. /rant

Apache::SSI is out because we aren't running mod_perl (see admins, brain-dead above) and I haven't tried the CGI::SSI module but I am shying away somewhat since it states that it doesn't handle all SSI and frankly since I'm using HTML::Template already, it seems using SSI intermixed would just be ugly and annoyingly like using two template systems.

What I want to do is just call the stats program from inside my own program. (BTW I can't just require it because its a C program)... I came up with the following code to put near the top of my scripts:

#!/usr/bin/perl use strict; { local $ENV{REQUEST_METHOD} = "GET"; local $ENV{QUERY_STRING} = "query_string_for_stats_prog"; system("stats.cgi"); }

Well here's my question, when I run this from the command-line (used a test script that printed out the %ENV hash) I get the expected results. But when I run it from the web I don't get anything, as though the system command completely fails.

Does anyone have an idea how I could solve this? It doesn't have to use system, anything would help right now! :)

Thanks in advance

Lobster Aliens Are attacking the world!

In reply to Do programs called with system() see the current %ENV? by cfreak

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.