in reply to Getting Log File for Current/Last Week
Seems to work pretty good.open (OLDTIME, "time.txt"); $time = <OLDTIME>; close(OLDTIME); #### Web 1 ##### $directory = "I\:\\logs\\iis\\W3SVC1\\"; opendir DIR, $directory or die "Couldn't open $directory : $!\n"; @files = readdir( DIR ) or die "Couldn't read from $directory : $!\n"; closedir( DIR ); @files = grep {/\.log$/} @files; foreach $line (@files) { $modtime = (stat("$directory$line"))[9]; if ($modtime > $time) { system("C:\\webalizer\\webalizer -c C:\\webalizer\\web1.conf $ +directory$line"); } } $nowtime = time(); open (TIME, ">time.txt"); print TIME "$nowtime"; close(TIME);
perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'
|
|---|