Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_perl thread: Forwarding or include


Message #1 by "Grant Zhong" <grantzhong@h...> on Fri, 29 Mar 2002 06:09:58
Within a Perl script, you always have the option of "shelling" another
Perl script and placing its output into a variable using the `
characters (the ` is to the left of the "1" key on a standard 101-key
keyboard).  For example:

#!/usr/bin/perl -w
print "Content-type: text/html\n\n";
my $result = `/usr/bin/perl -w /home/anubis/www/cgi-bin/question.pl`;
print $result;

However this probably doesn't help a whole lot if you're relying on the
passer (in this case, question.pl) to receive form data via a GET or
POST.

Keep in mind Perl was written with system administration in mind first,
and only later became the de facto standard for CGI programs, so it
lacks some of the things that a language/technology specifically written
for web crap has.  Usually you can find a package to help you out in
this area; I think LWP::UserAgent may help.  Search for packages at
search.cpan.org.

- Chuck

-----Original Message-----
From: Grant Zhong [mailto:grantzhong@h...] 
Sent: Friday, March 29, 2002 6:10 AM
To: Pro_Perl
Subject: [pro_perl] Forwarding or include

Does any one know in cgi programming how to include result of other perl

script and how to forward the HTTP request to another perl script (not 
redirection), just like forward and include in Java Servlet? Thanks.


  Return to Index