Hi Suz,
Just getting back from vacation so I'm a little late to the party
with this one.
Perl has a nive construct called "here document." It's very
helpful for bringing together groups of text without working about print
statements, qutoes and the like.
Build and test an HTML documnt as you normall would. Next
construct a skeleton for a perl script, something like:
#!/usr/bin/perl
print<<HTMLpart;
Content-type: text/html
HTMLpart
The "HTMLpart" is a tag and may be anything you like. Case matters and
the starting tag and ending tage must be the same. Note, the first line
must have a ";" following the "<<" while the last part cannot have a ";".
Also, don't leave a space between the "<<" and the tag.
Insert your html after leaving a blank line after the
"Content-type:" header. (Very important.)
If your case:
>
$gbook = "guestbook.txt";
print<<HTMLpart;
Content-type: text/html
<html><head><title>Guest Book</title></head>
<body bgcolor="#FFFFFF">
<center>
<font size=+3 color="#\6699CC">
Guest Book</font>
<blockquote><hr></center>
HTMLpart
#read this file
if(open(FILE, "$gbook"))
{
$line = ".";
while ($line ne "")
{
$line = <FILE>;
print $line;
}
close(FILE);
}
else
{
print "Can't open file\n";
}
print<<BottomHTML;
<hr width=50% align=center></blockquote>
</body></html>
BottomHTML
exit;
Urb, [EMAIL PROTECTED]
Visit America's Town Square. Creators of extraordinary Web sites.
http://www.usats.com Build your own Home Page without knowing
any HTML. Many user selectable options. After creation, your page
is e-mailed to you. http://usats.com/homepage
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------