Suppressing warnings.
"Scott Lillibridge" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.modules.mail-box |
|---|---|
| Message-ID | <001401c407bb$ddee3070$0f00010a@ITTBDEV3> |
I have the following code to read through some mboxes and automatically
delete old messages. I get a lot of WARNINGS about different messages with
the same id. I would like to suppress this, and only get ERROR messages. I
set the log to ERROR when I create the folder, but I still get the same
WARNINGS, no matter what I do. Is there some way to let only ERROR messages
get displayed? Am I completely wrong in thinking this is what log is
supposed to do?
--snip--
my $folder = Mail::Box::Mbox->new( log => 'ERROR',
folder => "$mbox",
access => "a")
or next;
my $count = $folder->messages;
## Calculate timestamps for later
my $age_seconds = $days*24*60*60;
#for( my $i=$count-1; $i >=0; $i-- ) {
for( my $i = 0; $i < $count; $i++ ) {
my $msg = $folder->message($i);
if ( ( $current_time - $msg->timestamp ) > $age_seconds ) {
$folder->message($i)->delete;
}
}
$folder->close;
--snip--
Scott Lillibridge
ITToolbox
Scottsdale, Arizona
P: 480-922-8302 x 113
F: 480-922-8303
[email protected]