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 ...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>"; for ( @cmd ) { chomp; $str .= "$_<BR>\n"; } $str; %]
... same thing. What am I doing wrong?[% 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; %]
| 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 | |
by Plankton (Vicar) on Sep 22, 2004 at 03:34 UTC | |
by Plankton (Vicar) on Sep 22, 2004 at 05:23 UTC |