#!/usr/bin/perl # Copyright 2000 - 2004 George Shaffer # Anyone may use or modify this code for any purpose PROVIDED # that as long as it is recognizably derived from this code, # that this copyright notice, remains intact and unchanged. # No warrantees of any kind are expressed or implied. $logfile = "m:\\alert\\wpserr.log"; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); $year += 1900; $year = substr($year,2,2); $tofile = "m:\\alert\\err$year" . (sprintf "%02.2d", $mon+1) . ".log"; open(IN, "<$logfile") or die "Can't open $logifle"; open(APPND, ">>$tofile") or die "Can't append to $tofile"; while () { print APPND; } close IN; close APPND; system "rm $logfile";