develooper Front page | perl.beginners | Postings from December 2002

Operations with dates

Thread Next
December 26, 2002 10:24
Operations with dates
Message ID:
Hi people ...
I need to erase e-mails based in their dates, when a mail is one month 
old I need to erase it or move it to another folder ... but I don't know 
if I could do operations like :

use Mail::Box::Manager;
$mgr = Mail::Box::Manager->new;
$inbox = "/var/spool/mail/marcelo";
$folder = $mgr->open($inbox);
$msg = $folder->message(3);
$head = $msg->head;
$maildate = $head->get('Date');
@splitdate = split  / /, $maildate;
$mailmonth = $splitdate[1];
$date = localtime;
    $_ = $date;

    /\w+ (\w+) *(\d+) (\d+):(\d+):(\d+) (\d+)/;

if ( $mailmonth < $month){
# do something

I don't know if that type of operations are permitted or if it gives me 
the right answer ..., and if there is another way to do that please tell 
me how ...Thanks !

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About