All it means is that it is a "script" which implements the Common Gateway Interface, being a protocol about passing data about the information request from the server to the script. This can be done through environment variables (the "GET" mode) or through STDIN (the "POST" mode) or through the command line (the "ISINDEX" mode). STDOUT is used for returning info from the script to the server (which might relay it to the client -- although that falls outside of the CGI protocol).
So the only way you can speak to a CGI script (which can be written in any language) is through "GET" or "POST" (we forget conveniently about the ISINDEX command line mode). Any other way of speaking to the "CGI script" (e.g. calling it directly as a subroutine or module or ...) does not use it as a CGI script but as a Perl, PHP, VB, ... program and will have to follow the rules for calling such programs. So strictly speaking there is no way under the CGI protocol to call a subroutine which lives in another CGI script. CGI scripts are, seen from the server, monolithic; they have one entry point, get their input from "GET" or "POST" and return their data through STDOUT. Whether the CGI script is one bunch of spagetti code or consists of 1,000 subroutines in 100 modules, is totally transparent for the caller. Unfortunately for your purpose it is also opaque: you can't see or access its parts separately.
So if you want to call another CGI script from within a CGI script you must launch a new request to the server (modules like LWP or WWW::Mechanize spring to mind). Still you will only be able to call this other CGI script as a whole.
If however you just want to call a subroutine which resides in another script or module or program, this has nothing to do with CGI at all and it is in no way different from useing, requireing or doing a subroutine in such used, required or done script, module or program (see use, require, do), provided of course these scripts, ... reside on the same server, are written in Perl and you have the necessary privileges to access them.
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law
In reply to Re^2: another CGI question ... passing values to another script
by CountZero
in thread another CGI question ... passing values to another script
by Angharad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |