print $html_preamble; # whatever's prolog to the real content open READ, $file or die "Oops! can't read $file: $!"; my $cnt = 0; while(my $line = ){ last if $cnt >= 43; # do we count rejected lines? no. next unless $line =~ /\w/; # lines with visible content print $line; $cnt++; } close READ; print $html_footer;