|Problems? Is your data what you think it is?|
Invoking a cgi script from another cgi script using system()by bibliophile (Parson)
|on Dec 31, 2014 at 21:33 UTC||Need Help??|
bibliophile has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to have a CGI script ("a.pl") call another CGI script ("b.cgi"), using system(). ("b.cgi" is used elsewhere; I just want to grab its (json) output and do things with it (using Capture::Tiny).
This works fine from the command line, but from the browser, "b.cgi" doesn't get the parameters that "a.pl" sends... or rather, the parms end up in @ARGV rather than $query->param.
Here's a minimal example. In this example, I'm not trying to process b.cgi's output in a.pl... I just want to show that b.cgi is not getting the parameters in $query->param.
Output when a.pl is invoked from the command line:
Output when a.pl is invoked through the browser:
Is there some difference between a command-line invocation and a system() invocation?
I'm clearly misunderstanding something here... Any help you could give would be... well... helpful!