monkjeff has asked for the wisdom of the Perl Monks concerning the following question:
This isn't the full code but a sample of the section I am talking about.#!/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,$hou +r,$min,$sec; open (OUT, '>OUTPUT.txt'); while ($line = <INFO>){ print $line . "<BR>"; #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 } } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: ASCII insert after read
by moritz (Cardinal) on Jul 29, 2008 at 19:46 UTC | |
by monkjeff (Initiate) on Jul 30, 2008 at 13:12 UTC | |
by moritz (Cardinal) on Jul 30, 2008 at 13:26 UTC | |
by monkjeff (Initiate) on Jul 30, 2008 at 14:16 UTC | |
by Anonymous Monk on Jul 30, 2008 at 18:26 UTC | |
by moritz (Cardinal) on Jul 30, 2008 at 18:41 UTC | |
Re: ASCII insert after read
by pc88mxer (Vicar) on Jul 29, 2008 at 19:40 UTC |