> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 13, 2001 11:23 AM
> To: CGI Beginners
> Subject: problem using script as ssi
> 
> 
> i have the following script:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> 
> my $file = /path/to/pancho-unstable";
> 
> print "<pre>";
> open(FH, $file);
> while(<FH>) {
>   s/\\\@/@/g;
>   s/>/\&gt;/g;
>   s/</\&lt;/g;
>   print if /USE/.../USE/ and !/USE/;
> }
> close(FH);
> print "</pre>";
> 
> 
> when i include this script as an ssi through:
> 
> <!-- #exec cgi="cgi-bin/parse.pl" -->
> 
> nothing prints except for the html included in the .shtml file.
> however, when i rewrite the above script as follows:
> 
> #!/usr/bin/perl -w
> 
> use strict;
> use CGI ':standard';
> 
> my $file = "/path/to/pancho-unstable";
> 
> print header;
> print start_html("Pancho Man Page");
> print "<pre>";
> open(FH, $file);
> while(<FH>) {
>   s/\\\@/@/g;
>   s/>/\&gt;/g;
>   s/</\&lt;/g;
>   print if /USE/.../USE/ and !/USE/;
> }
> close(FH);
> print "</pre>";
> print end_html;
> 
> 
> the desired results occur. can someone explain why i am seeing these
> results?

Because the former is not a valid CGI script, while the latter is?

You can use the directive:

   <!-- #exec cmd="cgi-bin/parse.pl" -->

To execute the script with /bin/sh, which would allow your first
script to work as you intend.

(Also note that mod_include docs recommend using #include virtual
instead of #exec cgi)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to