#!/usr/bin/perl use CGI qw(:standard); open(INFO, "testdoc.txt"); print header(); print start_html(); my @record; my %hash; my $true = 0; $i =0; my $FEI; ($sec,$min,$hour,$mday,$mon,$year,$wday, $yday,$isdst)=localtime(time); #printf "%4d-%02d-%02d %02d:%02d:%02d\n", $year+1900,$mon+1,$mday,$hour,$min,$sec; open (OUT, '>OUTPUT.txt'); while ($line = ){ print $line . "
"; #check each character of the line for a page break for (split//,$line) { $test = sprintf "\%3o\n", ord $_; if ($test == 14) { # WE HAVE FOUND A NEW PAGE $true = 1; $hash->{$i} = $line . $test; $i++; # store next 8 lines in a hash } } } }