#!/usr/local/bin/perl -w use strict; 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; #### Content-Type: text/html; charset=ISO-8859-1 Whatever Use of uninitialized value in print at ./test.pl line 8. readline() on closed filehandle main::FILE at ./test.pl line 12.