in reply to Re: Re: Executing another script from a CGI
in thread Executing another script from a CGI
Supplying the full path will get this additional script to run, but I don't think you're going to get the output from the command by grabbing the return value from system().
What you'll get stored in $output will simply be the exit code from your other script.
So here's how you can execute the external script and grab the output into a variable:
open (PROC "/path/to/perl myscript.pl |") || die "horribly"; @lines = <PROC>; close PROC;
You may want to add other civilities, such as join()'ing the lines of output into one big scalar if that suits you. But this is one good way of grabbing output from a running process. Best of luck.
---v
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Executing another script from a CGI
by derby (Abbot) on Jul 25, 2002 at 01:24 UTC | |
|
Re: Re: Re: Re: Executing another script from a CGI
by higle (Chaplain) on Jul 25, 2002 at 14:06 UTC |