CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Execute perl script within another script


Warren Bell

Dec 31, 2000, 9:53 PM

Post #1 of 2 (414 views)
Execute perl script within another script Can't Post

Is there a way to run one perl script and capture, or print out the output from withing another perl script? I have a script that builds a page from a template and a content page. In the content page I have an SSI command that I want my current script that's processing that page to execute. I'm trying to have my script act the same as SSI and keep it backward compatible with SSI tags. IS there any way to execute one CGI script within another?


for ($b = 0; $b < @template; $b++) {

$_ = $template[$b];

if (//) {

# somehow exec $1 and run it to have the same output as if I ran it with the SSI tag



User / Moderator

Jan 1, 2001, 11:53 AM

Post #2 of 2 (408 views)
Re: Execute perl script within another script [In reply to] Can't Post

I am not going to offer my SSI solution yet because I am still working on it.

But I would like to point out that this...

for ($b = 0; $b < @template; $b++) { 
$_ = $template[$b];
#do something cool with $_

is a complicated way of saying...

foreach (@template) { 
#do something cool with $_

In perl we have foreach which is built just for this type of thing.

As a refuge from 'C' I did not want to give up on for, but eventually I saw the light, and my perl code is now much better.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives