# head.html
####
# body.html
Simple CGI Example for doo_the_dew
####
#!/usr/bin/perl -w
# Libraries
use strict;
use warnings;
use CGI::Carp qw{ fatalsToBrowser };
use IO::File;
# IMPORTANT -- CGI scripts need to provide the header
print "Content-type: text/html\n\n";
# Main program
insert_file("head.html"); # Insert common header
insert_file("body.html"); # Insert common body start
#
# YOUR CODE HERE
#
# Subroutines
sub insert_file {
my ($fn) = @_;
my $fh = new IO::File;
open($fh, "<", $fn) or die "Can't read file '$fn' ($!)\n";
foreach (<$fh>) {
print;
}
close $fh;
}