use CGI; my $q = new CGI; print $q->header, # create the HTTP header $q->start_html('Whatever'), # start the HTML open(FILE, "data.txt"); while(){ chomp; print "Saw $_ in data.txt
\n"; } close FILE; print $q->end_html;