Connecting Tech Pros Worldwide Forums | Help | Site Map

Perl CGI and Apache SSI

Newbie
 
Join Date: Nov 2006
Posts: 3
#1: Nov 27 '06
Hi, I have an index.html that includes files using the include directive from Apache mod_include. I have an header, menu and footer.

What I want is to be able to include this files in a perl cgi script.

How can I do this?

I was trying CGI::SSI_Parser and using fssi($filename) but no good...

I've tried:

Expand|Select|Wrap|Line Numbers
  1. use CGI::SSI_Parser;
  2.  
  3. fssi("./header.html");
  4.  
  5. sssi('<!--#include virtual="./header.html" -->');
  6.  

Member
 
Join Date: Nov 2006
Posts: 83
#2: Nov 27 '06

re: Perl CGI and Apache SSI


Why don't you just do:
Expand|Select|Wrap|Line Numbers
  1. open my $header, '<', './header.html' or die $!;
  2. print <$header>;
miller's Avatar
Moderator
 
Join Date: Oct 2006
Location: San Francisco, CA
Posts: 830
#3: Nov 28 '06

re: Perl CGI and Apache SSI


CGI::SSI_Parser is old and should be deprecated. Instead use CGI::SSI or Apache:SSI.
Newbie
 
Join Date: Nov 2006
Posts: 3
#4: Nov 29 '06

re: Perl CGI and Apache SSI


Well I'm using HTML::Template...
Reply