dbs has asked for the wisdom of the Perl Monks concerning the following question:
But it still prints the "cant find Zlib warnings" in my csv file, which I do not want. Please help! thx!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 $@; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: ignoring warnings in eval
by chromatic (Archbishop) on Aug 12, 2011 at 20:55 UTC | |
|
Re: ignoring warnings in eval
by ikegami (Patriarch) on Aug 12, 2011 at 20:52 UTC | |
|
Re: ignoring warnings in eval
by JavaFan (Canon) on Aug 12, 2011 at 21:49 UTC |