SERVER_NAME = onwardoverland.com SERVER_SOFTWARE = Apache hitstats3.cgi
$0 = disp5.cgi, $thisfile = disp5.cgi
T here are 2 scripts :-  hitstats3.cgi and disp5.cgi.

This is hitstats3.cgi :- top
#!/usr/bin/perlml
use integer;
use strict;
use CGI qw(:standard);
$| = 1;
print header; #print "Content-type: text/html\n\n";
open (STDERR, ">&STDOUT");
use CGI::Carp qw(fatalsToBrowser);
use File::Basename;
my ($windows8, $thisfile, $server, $software);
my ($dirname, $num, $file, @lines, %string, %fromfile, $r3, $r0, $r1);
my ($date, $count, $key, %sortedkey, $total, $number_of_columns, $order, $order1, $type, $sortby, $fromfile);
$number_of_columns = 6;
$server = $ENV{SERVER_NAME}; # like onwardoverland.com
$software = $ENV{SERVER_SOFTWARE}; # like Microsoft-IIS/8.0
if (substr($software, 0, 13) eq "Microsoft-IIS"){$dirname = "c:\\devhtml\\count\\count";
}else{
$dirname = "../count/count";}
if(!defined($order = param("order"))){$order = 1;}
if ($order==0){
$order1 = 1;
$type = "name";
$sortby = "sort by hits";
}else{
$order1 = 0;
$type = "hits";
$sortby = "sort by name";
}
$thisfile = basename($0);
#print "\$0 = $0, \$thisfile = $thisfile ";
&get_date;
&doit;
&print_outfile;

sub print_outfile {
print << "(END OF START)";
<HTML><HEAD><TITLE>List of ($count) hit counters sorted by $type on $date</TITLE></HEAD>
<BODY BGCOLOR=thistle><FONT FACE=ARIAL SIZE=4>
<CENTER><B>List of ($count) hit counters sorted by $type on $date</B>
<FONT SIZE=1>
&nbsp;&nbsp;<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/index.html>home</A>&nbsp;
<A HREF=hitstats3.cgi?order=$order1>$sortby</A>&nbsp;
<A HREF=disp5.cgi>source</A>&nbsp;
<A HREF=hitstats9.cgi>hitstats9</A></CENTER>
<TABLE><TR>
(END OF START)
&printit;
print << "(END OF END)";
</TR></TABLE>
<BR><FONT SIZE=1><CENTER>
Page created on March 22nd. 2006, updated on December 2nd. 2013 and again on August 13th. 2015.
<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/index.html>home</A>&nbsp;
<A HREF=hitstats3.cgi?order=$order1>$sortby</A>&nbsp;
<A HREF=disp5.cgi>source</A>&nbsp;
<A HREF=hitstats9.cgi>hitstats9</A>&nbsp;
You are visitor number:
<IMG SRC=number9.cgi?style=N&width=7&update=Yes&countfile=jblack_hitstats3.txt
width=168 height=28 alt="number of hits">
</CENTER>
</HEAD></HTML>
(END OF END)
}

sub doit {
$count = 0; $total=0;
opendir(DIR, $dirname) or die "can't open $dirname: $!";
while (defined($file = readdir(DIR))) {
if ($file ne "." and $file ne "..") {
open (FH, "<$dirname/$file") or die "can't open $file: $!";
@lines = <FH>;
close (FH);
$num = $lines[0]; $total += $num;
if (!defined($fromfile = $lines[1])) { $fromfile = "/"};
$file =~ s!jblack_!!;
$file =~ s!.txt!!;
$string{$file} = $num;
if ($fromfile ne "formost" && $fromfile ne "guest") {$fromfile{$file} = $fromfile;} else {$fromfile{$file} = "/";}
$count++;
}}
close (DIR);
}

sub sortof {
if ($order == 0){
$a cmp $b ;
}else{
$string{$b} <=> $string{$a} ;
}
}

sub printit {
$r0 = 0;
$r1 = 0;
$r3 = $count/$number_of_columns;
foreach $key ( sort sortof (keys (%string))) {
if ($r0==0){
print "<TD width=200 VALIGN=TOP><TABLE><TR><TD width=120><B>Web page</B></TD>\n";
print "<TD width=30 align=right><B>Hits</B></TD></TR>\n";
}
$r0++;
$r1++;
print "<TR><TD><FONT SIZE=2><A HREF=$fromfile{$key}>$key</A> \n";
print "</TD><TD align=right><FONT SIZE=2>$string{$key} </TD></TR>\n";
if ( $r1 >= $count ) {
print "<TR><TD>Total</TD><TD>$total</TD></TR></TABLE>\n";
last;
}
if ($r0 > $r3){
print "</TABLE>\n";
$r0=0;
}
}
}


sub get_date {
my ( @days, @months, $time, $year, $sec, $min, $hour, $mday, $mon, $wday);
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
$time = sprintf("%02d:%02d:%02d",$hour,$min,$sec);
$year += 1900;
$date = "$days[$wday], $months[$mon] $mday, $year at $time";
}




This is disp5.cgi :- top
#!/usr/bin/perlml
use strict;
$| = 1;
print "Content-type: text/html\n\n";
open (STDERR, ">&STDOUT");
use CGI::Carp qw(fatalsToBrowser);
use File::Basename;
my ($windows8, $source1, $thisfile, $server, $software);
$server = $ENV{SERVER_NAME}; # like onwardoverland.com
$software = $ENV{SERVER_SOFTWARE}; # like Microsoft-IIS/8.0
if (substr($software, 0, 13) eq "Microsoft-IIS"){$windows8 = "c:\\devhtml\\cgi-bin\\";}else{$windows8 = "";}
$source1 = "hitstats3.cgi";
$thisfile = basename($0);
#print "\$0 = $0, \$thisfile = $thisfile ";
print << "(END OF HEADING)";
<HTML><HEAD><TITLE>This is the source listing of $source1 and $thisfile</TITLE>
<SCRIPT language=JavaScript>
if (self.parent.frames.length != 0)
self.parent.location=document.location.href;
</SCRIPT>
</HEAD>
<BODY BGCOLOR=thistle><A NAME = top><FONT FACE=ARIAL SIZE=3>
SERVER_NAME = $server SERVER_SOFTWARE = $software <A HREF=$source1>$source1</A><BR>
\$0 = $0, \$thisfile = $thisfile<BR>
<FONT FACE=ARIAL SIZE=6>T<FONT FACE=ARIAL SIZE=3>
here are 2 scripts :-&nbsp;
<A HREF=#$windows8$source1>$source1</A> and <A HREF=#$windows8$thisfile>$thisfile</A>.<BR>
(END OF HEADING)
&disp($source1);
&disp($thisfile);
print << "(FOOTER)";
<BR><BR><FONT SIZE=2><CENTER>
<A HREF=$source1>$source1</A>&nbsp;&nbsp;<A HREF=#top>top</A>&nbsp;&nbsp;
Page created on August 3rd. 2015. You are visitor number&nbsp;
<IMG width=140 height=27 SRC=number9.cgi?style=I&width=7&update=Yes&countfile=jblack_disp5.txt>
<BR>
</BODY></HTML>
(FOOTER)

sub disp{
my ($source, @lines, $storey);
$source = $windows8 . $_[0];
open(SOURCE, $source) or die ("Can't open $source: $!");
@lines = <SOURCE>;
close(SOURCE) or die ("Can't close $source: $!");
print "<BR><A NAME = $source><FONT COLOR = red>This is $source :- <FONT COLOR = black><A HREF=#top>top</A><BR>\n";
foreach $storey (@lines){
chop($storey);
$storey =~s/&/&amp;/g;
$storey =~s/</&lt;/g;
$storey =~s/>/&gt;/g;
print "$storey<BR>\n";
}
}


hitstats3.cgi  top   Page created on August 3rd. 2015. You are visitor number