Plankton has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

You all probably know I have been messing with the Everything Engine. So here's a question I hope some monks can help me with. I created a restricted_superdoc and I want this restricted_superdoc display the output of tail -15 /usr/local/apache2/log/access_log

So I do ...
[% my @cmd = `/usr/bin/tail -15 /usr/local/apache2/log/access_log`; my $str = "<HR>"; for ( @cmd ) { chomp; $str .= "$_<BR>\n"; } $str; %]
that didn't display anything overthan the <HR&gr; tag. So i tried this ...
[% my $cmd = '/usr/bin/tail -15 /usr/local/apache2/log/access_log'; my $str = "<HR>"; open TAIL, "$cmd|" or $str .= "$!"; while ( <TAIL> ) { chomp; $str .= "$_<BR>\n"; } close(TAIL); $str; %]
... same thing. What am I doing wrong?

Plankton: 1% Evil, 99% Hot Gas.

Replies are listed 'Best First'.
Re: Executing OS commands from Everything Engine
by tachyon (Chancellor) on Sep 22, 2004 at 03:29 UTC
    One logical explanation is that access_log is empty.

    cheers

    tachyon

      Nope there stuff in it ... oh I get it your making a joke. Ha Ha very funny.

      Plankton: 1% Evil, 99% Hot Gas.

        In the off chance that some will have a similuar problem I will post what I did to deal with this

        The problem the ../logs directory is outside the DocRoot of th eapache web server so I had to create a symbolic link to th elogs dir. and modify my perl code accordingly.


        Plankton: 1% Evil, 99% Hot Gas.