Hi. I'm having trouble with the Mail::Box::Manager modules in perl. What I'm trying to do is write a script which parses through an mbox mail file and pulls out certain messages based on the date they were written. The script should then add those messages to a new folder. I keep getting error messages which say that there are no methods for moving messages from one mbox to another. My code is below. Anybody have any ideas? Thanks.
Ali
#!/usr/local/bin/perl
#usage: ./ml.pl alihakim 2003-05-01 2003-05-31
$filename = shift;
#$filename2 = shift;
use Date::Calc qw( Date_to_Days Time_to_Date );
use Date::Parse qw( str2time );
use Time::CTime qw( strftime asctime );
use lib "...";
use Mail::Box::Manager;
my $start_time = shift;
$start_time =~ m/^\d{4}-\d{2}-\d{2}$/ or die;
$start_time = str2time( "$start_time 00:00:00" );
my $stop_time = shift;
$stop_time =~ m/^\d{4}-\d{2}-\d{2}$/ or die;
$stop_time = str2time( "$stop_time 00:00:00" );
#print "20: $start_time\n";
#print "21: $stop_time\n";
$mgr = Mail::Box::Manager->new();
my $ali = Mail::Box::Mbox->new();
$folder = $mgr->open ('mbox',$filename);
my $new_folder;# = $ali->open('test','file','./',"create","1","access"
+,"rw");
foreach $message ($folder->messages())
{
$curr_msg++;
my $time = $message->guessTimestamp();
my $atime = asctime (localtime($time));
if (($time >= $start_time) && ($time <= $stop_time))
{
$ali->addMessage($message);
}
}
$folder->close();