Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling CGI script from within CGI script...

Status
Not open for further replies.

Patmor

Programmer
Mar 23, 2004
1
US
Hello,

Here's my problem (I'm new to PERL; only 5 days in):
I have two independent CGI scripts that I want to process the results of a FORM. I use "EXEC('script2.cgi')" from within script1, but then I do not see the results after calling script2. Does the first script destroy the $ENV{'QUERY_STRING'}? Can the EXEC command handle args? If so, how do I pass the $ENV~ variable? (I do not have a PERL manual just yet).

Thank you...
Patmor
 
Calling cgi from cgi is not a really good way to be handling this. The better way to do it would be to encapsulate your logic into libraries that -both- scripts can use.

Then, in script1 you can access the same logic as script2 which eliminates the need to actually call script2.

Each CGI instance is unique so there is no super clean way to handle passing through your ENV and QUERY to the sub-invocation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top