in reply to Rolling over a Parser File
Make sure the filename is based on the current date and always open for each write. Something like
sub loggit { my @gmt = gmtime; my $date = sprintf "%04d%02d%02d", $gmt[5]+1900, $gmt[4]+1, $gmt[3 +]; my $file = "$date.log"; open my $log, ">>", $file or die $!; print $log, @_; close $log; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Rolling over a Parser File
by ahuang14 (Novice) on Aug 08, 2011 at 18:18 UTC | |
by ahuang14 (Novice) on Aug 08, 2011 at 18:49 UTC |
In Section
Seekers of Perl Wisdom