http://www.perlmonks.org?node_id=449725


in reply to Rotating output from the Perl debugger

I would suggest using Log::Dispatch::FileRotate for this. You can use LineInfo to direct the logging output to a pipe, running a script like this (not tested):
use strict; use Log::Dispatch::FileRotate; my $file = Log::Dispatch::FileRotate->new( name => 'file1', min_level => 'info', filename => 'Somefile.log', mode => 'append' , TZ => '0:0:0:0:2:00:0', DatePattern => 'yyyy-dd-HH', ); while (<>) { $file->log( level => 'info', message => $_); }