Gossamer Forum
Home : General : Perl Programming :

Get a scripts output from within another script?

Quote Reply
Get a scripts output from within another script?
Hi,
I have written a script that will hopefully write the output from a call to another script to an htm file.

I can do this fine until I ad some name, value pairs to the call and then it just fails.

Here`s my code..

Code:
$variables = "?mypage=This&mytitle=Main";

$builditpage = `perl output.cgi$variables`;

After that I take the value of $builditpage and save it to file.

Now if the $variables is empty it works but if it has a value it fails. Is there a specific way to include them, thanks for any pointers.

chmod
Quote Reply
Re: [chmod] Get a scripts output from within another script? In reply to
You could do something like this:
Code:
local $ENV{QUERY_STRING} = 'mypage=This&mytitle=Main';
my $output = qx|perl /path/to/output.cgi|;

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Get a scripts output from within another script? In reply to
Cheers Yogi,
unfortunately still the same.

I am now using your setup and I called an env variable script instead to see what the environment on the called script is like and found that the variables are being passed in using the POST method.

Perhaps thats what is choking it, I just dont know..

chmod