Welcome to WebmasterWorld Guest from 22.214.171.124
IŽd suggest reading Marcia`s WebmasterWorld Welcome and Guide to the Basics [webmasterworld.com] post which contains a lot of useful information.
CGI is not a programming language but a convention on how a webserver and external programs may communicate. To answer your question one would need to know which language you are using. For an example of how to include PHP [php.net] scripts into a Perl [perl.com] script see having include problems - Including html file in cgi script [webmasterworld.com].
Those two lines will run the PHP [php.net] binary. The second method using a list of arguments is safer since it does not use the shell. The output will be sent to STDOUT just like the output of the rest of your Perl [perl.com] script.
Using backticks you can gather the output of running the PHP [php.net] scripts. This method is inefficient if all you do is print out the variable. So use this only if you want to modify the output from within your Perl [perl.com] script.
$output = `php4 -q /path/top.PHP [php.net]`;
I used the following code:
my $ifile = "php4 -q /home/site1/web/top.html¦";
open ('TEMP', $ifile) or die("Can't open file $ifile: $!\n");
my @contents = <TEMP>;
print "Content-type: text/html\n\n";
But then I get:
Can't open file php4 -q /your/path/to/top.html¦: No such file or directory