cfreak has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Do programs called with system() seen the current %ENV?
by diotalevi (Canon) on Mar 17, 2003 at 23:27 UTC | |
|
Re: Do programs called with system() see the current %ENV?
by Steve_p (Priest) on Mar 18, 2003 at 02:41 UTC | |
|
Re: Do programs called with system() see the current %ENV?
by cfreak (Chaplain) on Mar 18, 2003 at 14:40 UTC |