in reply to How can I get SSI tags works in Perl script?

If you are using Perl, you really don't need to also use SSI, unless your ISP has a bunch of prebuit SSI's for you to use. Here's my untested code for this:

#!/usr/bin/perl -w use strict; use CGI qw(:standard); print start_html(); open( TEXT, "</blah/header.txt" ) or die "missing text file: $!"; my @insertion; while( <TEXT> ) { chomp; push( @insertion, $_ ); } close TEXT; print p( join( '', @insertion ) ); print end_html();


or something like that. There's lot of ways to do it, but CGI is a good habit to get into for all of them.

Replies are listed 'Best First'.
Re: (ichimunki) Re: How can I get SSI tags works in Perl script?
by mezz (Initiate) on Jul 20, 2001 at 06:11 UTC
    Yes, you are right about it. It can be open the file then print instead of using SSI tag. I never thought of it.

    Umm, about CGI:SSI, I think it's useless because not many host has the moducle for it.

    Thanks guys! =0)

    Mezz
      You can always install modules in your own directory assuming you already have CGI going. You have to play with @INC and a few other details but just because the server doesn't have a certain module installed is no reason not to use it.

      ----------------------------------------------------- Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain