use strict; use warnings; use Date::Manip; use CGI qw/:standard/; # Make sure security is not compromised by calling unpathed programs. $ENV{PATH} = "/bin:/usr/bin:/usr/local/bin:"; $ENV{IFS}=""; # Use CGI to print the header print header; # Make variables local only my %referers = (); my $row = 0; my $counter = 0; # Retrieve and security-check parameters my $site = param('site'); my $hour = param('hour'); my $minute = param('minute'); if ($hour !~ /^\d\d?$/) { die('Invalid hour'); } if ($minute !~ /^\d\d?$/) { die('Invalid minute'); } # Get date object for the checkpoint my $check_date = ParseDate("${hour}hours ${minute}minutes ago"); # Select the server log - current 12/19/02 my $data = ''; if ($site eq 'star') {$data = 'indystar/access_log'} elsif ($site eq 'topics') {$data = 'topics/access_log'} else {$data = 'noblesville/access_log'} # Create headline for web page print "
"; print FILE "$_ - $referers{$_}
"; ++$counter; } elsif ($counter > 10 && $counter <= 20) { if ($counter == 11) { print "
Next
";
print FILE "
Next
";
open (FILE2, ">storage2.txt") || die('Could not open $storage2.txt: $1');
print FILE2 "$_ - $referers{$_}
"; ++$counter; } } elsif ($counter > 20 && $counter <= 30) { if ($counter == 21) { print "
a href=\"storage2.txt\">Previous Next
";
open (FILE3, ">storage3.txt") || die('Could not open $storage3.txt: $1');
print FILE3 "$_ - $referers{$_}
"; ++$counter; } } elsif ($counter > 30 && $counter <= 40) { if ($counter == 31) { print "
a href=\"storage3.txt\">Previous
";
open (FILE4, ">storage4.txt") || die('Could not open $storage4.txt: $1');
print FILE4 "$_ - $referers{$_}
"; } } } close FILE; close FILE2; close FILE3; close FILE4;