I read http://www.perlmonks.org/index.pl/?node_id=685329 but did not get it to work in my code, so I added the SIG WARN code:
sub _logroll {
eval 'use Compress::Zlib';
my $gzip = $@ ? '/usr/bin/gzip' : 'lib';
for my $log_file ( @_ ) {
my $rotator = Logfile::Rotate->new(
File => $log_file,
Count => 15,
Dir => $dir,
Gzip => $gzip,
Flock => 'yes',
Persist => 'yes'
);
$rotator->rotate();
}
$SIG{__WARN__} = sub {
open (STDERR, ">/dev/null");
print STDERR $@;
}
}
But it still prints the "cant find Zlib warnings" in my csv file, which I do not want. Please help!
thx!