Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect10_01.pl
#
# first cgi-bin script using CGI.pm --- returns
# contents of an HTML file
#
# by Sharon Tuttle
#
# last modified: 11-02-04
#######################################################
#1
use CGI qw(:standard);
open HTML_INPUT, "< lect09_01_html_contents"
or die "Cannot open lect09_01_html: $!";
#2
# CGI scripts must send back a response following a strict
# protocol; we did this earlier with the line:
# print "Content-type: text/html", "\n\n";
# Now, though, we'll call header, a CGI.pm function that:
# [Practical Perl with CGI Applications, Chang, p. 161]
# "...will return a scalar whose value is a correctly-
# constructed HTTP Content-Type header for text/html,
# including the standard character set and the subsequent
# blank line."
print header;
# no need to change this (yet) --- it is reading HTML from
# another file and printing it out, remember.
# will this post the current contents of this file?
while (<HTML_INPUT>)
{
$next_line = $_;
print $next_line;
}
close HTML_INPUT;
# end of lect10_01.pl