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

Operations with dates

Thread Next
From:
Marcelo
Date:
December 26, 2002 10:24
Subject:
Operations with dates
Message ID:
3E0B4B3B.3020500@espoltel.net
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+)/;
    $month=$1;

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


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About