#!/usr/bin/perl $mailprog = '/usr/sbin/sendmail'; $count="on"; if (defined($ENV{'HTTP_COOKIE'})) { %Cookies = map split (/=/), split (/; /,$ENV{HTTP_COOKIE}); $count = $Cookies{'count'}; } print "Set-Cookie: count=off; \n"; print "Content-type: text/html\n\n"; @Zeilen = (); open(navigate, "){ push(@Zeilen,$_);} close(navigate); open(counter, "+>>dat/counter.dat"); flock(counter, 2); seek counter, 0, 0; $cnt = ; truncate counter, 0; if ($count ne "off") { $cnt++; } print counter $cnt; flock(counter, 8); close(counter); @dirs=('/home/kunden/k0082/htdocs/','/home/kunden/k0082/htdocs/cgi-bin/','/home/kunden/k0082/htdocs/cgi-bin/src/','/home/kunden/k0082/htdocs/wap/','/home/kunden/k0082/htdocs/fun/'); foreach $dir (@dirs) { opendir(DIR,$dir); @dirfiles = readdir(DIR); closedir(DIR); $dir =~ s/\/$//; foreach $file (@dirfiles) { unless ($file =~ /^$dir/) { $file = $dir."/".$file; } if (($file =~ /\./) && !($file =~ /^\./) && !($file =~ /\.dat/) && (-T "$file")) { $mtime = (stat($file))[9]; ($f,$g,$h) = (localtime($mtime))[3,4,5]; $h += 1900; $g++; if (length($g)==1) {$g="0$g";} if (length($f)==1) {$f="0$f";} $date = "$h.$g.$f"; push (@files,"$date-$file"); } } } @files=reverse sort(@files); @dat=split(/-/,$files[0]); ($j,$m,$t)=split(/\./,$dat[0]); $j = substr($j, 2); $update="$t.$m.$j"; for(@Zeilen){ print "$_"; if($_ =~ "") { print "$cnt"; } if($_ =~ "") { print "$update"; } }