rsiedl has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I'm attempting to call a .cgi script from another one of my scripts and for some reason it is only recognising the first var I pass to it.
i.e.
Anyone got any ideas?
Cheers,
Reagen
Update: I've done a bit more investigating and it appears that the script being called from the original script is using the var's from that original script.
i.e. some_script.cgi?blah=foo&larh=bar will pass the vars blah and larh onto the script that some_script.cgi calls...
make sense?
I havent been able to work out how to prevent that and specify my own when I call the script. Anyone?
Here's some code that explains more clearly than I:
script1.cgi
I'm attempting to call a .cgi script from another one of my scripts and for some reason it is only recognising the first var I pass to it.
i.e.
and some_script.cgi is only seeing the results from var blah`perl some_script.cgi blah=foo larh=bar`;
Anyone got any ideas?
Cheers,
Reagen
Update: I've done a bit more investigating and it appears that the script being called from the original script is using the var's from that original script.
i.e. some_script.cgi?blah=foo&larh=bar will pass the vars blah and larh onto the script that some_script.cgi calls...
make sense?
I havent been able to work out how to prevent that and specify my own when I call the script. Anyone?
Here's some code that explains more clearly than I:
script1.cgi
script2.cgi#!/usr/bin/perl use strict; use warnings; use CGI qw(:all); print header; my $blah = `perl ./tmp.cgi 'var1=one&var2=two'`; print "<pre>", $blah, "</pre>\n"; exit;
The only way I can get var1 and var2 to print is by calling script1.cgi?var1=one&var2=two even though I define that in script1 where I call script2.#!/usr/bin/perl use strict; use warnings; use CGI qw(:all); my $q = new CGI; my $var1 = $q->param("var1"); my $var2 = $q->param("var2"); print $var1, "\n"; print $var2, "\n"; exit;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: CGI from another script
by jeffa (Bishop) on Sep 02, 2005 at 13:50 UTC | |
by rsiedl (Friar) on Sep 02, 2005 at 13:57 UTC | |
by ww (Archbishop) on Sep 02, 2005 at 14:30 UTC | |
by rsiedl (Friar) on Sep 02, 2005 at 14:42 UTC | |
Re: CGI from another script
by ikegami (Patriarch) on Sep 02, 2005 at 14:12 UTC | |
Re: CGI from another script
by kutsu (Priest) on Sep 02, 2005 at 15:41 UTC | |
by rsiedl (Friar) on Sep 03, 2005 at 06:41 UTC | |
by kutsu (Priest) on Sep 06, 2005 at 14:50 UTC |
Back to
Seekers of Perl Wisdom