http://qs321.pair.com?node_id=1111906


in reply to Re: Invoking a cgi script from another cgi script using system()
in thread Invoking a cgi script from another cgi script using system()

Ah, yes. That's better :-)

(In the real project, I'm going to pull the guts out of "b.cgi" into a new "c.pm", and have both a.pl and b.cgi use c.pm to do the heavy lifting, without needing to mess about with having a.pl capturing output from b.cgi)

Thanks for the tip on CGI.pm, too. $DEBUG was actually set to 1 (meaning that this *should* have worked...) I still don't know why it didn't work, but I learned something new today, and that's always a win.

Thanks.

  • Comment on Re^2: Invoking a cgi script from another cgi script using system()

Replies are listed 'Best First'.
Re^3: Invoking a cgi script from another cgi script using system()
by Anonymous Monk on Jan 02, 2015 at 04:31 UTC
    You could also write like this because webservers won't put stuff into @ARGV
    my $query = @ARGV ? CGI->new({ @ARGV }) : CGI->new;

    Invoke as

    system $^X, 'foo.cgi', qw/ key value key value /;