#!/usr/comp/bin/perl
print "Content-type:text/html\n\n";

open(INF,"test1.out") or dienice("Couldn't open test1.out for reading: $! \n");
@data = <INF>
close(INF);

print <<FHTML;
<html><head><title>Name Pairs</title></head>
<body>
<h2 align="CENTER">Name Pairs</h2>
FHTML

foreach $i (@data) {
    chomp($i);
    # to get their first and last names
    $count++;   
    print "First Name: ",$fname," Last Name: ",$lname, "<br>";
}

print "<p>";
print "Total pairs so far: "; # print the total counts here

print <<EndHTML;
</body>
</html>
EndHTML

sub dienice {
    my($msg) = @_;
    print "<h2>Error</h2>\n";
    print $msg;
    exit;
}