> On Wed, Jul 14, 2004 at 10:13:13AM -0500, Alex Brelsfoard wrote:
>> I hate to bug you all with a perl question like this seeing as I am new
>> to
>> the group. But I'm getting kinda stuck on this one. I am simply trying
>> to read in an external html file (to be used as the header of a web
>> page)
>> and then print it out. That sounds nice and easy. However, the header
>> file contains SSI, and not just an include, and sets and echos. I've
>> been
>> trying to get CGI::SSI to work, but, near as I can tell, it's not
>> understanding the set commands or the if/else commands in SSI. Do you
>> guys have any suggestions on this one? I KNOW there has to be a way....
>
> According to the CGI::SSI docs it does understand the echo and if/else
> control
> structures so something must be wrong. More information and sample data is
> probably in order.
>
> -Gyepi
Well, let me show you the snip-it's of code. If you feel inclined to
offer advice, I eagerly welcome it:
### perl script ###
my $ssi = CGI::SSI->new();
my $header = '';
open (HEAD, $HTMLHeaderFile);
while (<HEAD>) {
chomp($_);
$header .= $ssi->process($_);
$header .= "\n";
}
close (HEAD);
print $header;
### end perl script ###
### HTMLHeaderFile ###
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>WPI <!--#if expr="$REQUEST_URI = /blah/" -->blah<!--#elif
expr="$REQUEST_URI = /foo/" -->foo<!--#else -->Bar<!--#endif -->
<!--#if expr="$title" -->: <!--#echo var="title" --><!--#endif --></title>
<!--#if expr="$HTTP_USER_AGENT != /WebTV/ " -->
<link rel="Stylesheet" type="text/css" href="/format.css">
<link rel="Stylesheet" type="text/css" href="/Academics/format.css">
<link rel="stylesheet" type="text/css" media="print" href="/formatprint.css">
<!--#endif -->
</head>
<body bgcolor="#ffffff" link="#990000" vlink="#555555" alink="#555555">
### end HTMLHeaderFile ###
Right now everything is working except that if statement with
HTTP_USER_AGENT.
Thanks again.
--Alex
WPI
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm