I wrote a script that moves and renames folders and the beginning of each month.
The problem is that when I print the new names out they appear as 

Listserv.Info-Cyrus.2002-January 

but when the program actually runs the names come out as

Listserv.Info-Cyrus.2002-0

as ideas?

Here is the code


#! /usr/bin/perl
use strict;
#set parameter for logginn into Cyrus
use IMAP::Admin;
my $mailhost = 'xxxxx';
my $username = 'xxxxx';
my $password = 'xxxxx';

#Get get and convert to Character month
#Then, combine into desired format

my $cmonth;
my $date;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isday) = localtime(time);
$year +=1900;

if ($mon==1){$cmonth='January'};
if ($mon==2){$cmonth='February'};
if ($mon==3){$cmonth='March'};
if ($mon==4){$cmonth='April'};
if ($mon==5){$cmonth='May'};
if ($mon==6){$cmonth='June'};
if ($mon==7){$cmonth='July'};
if ($mon==8){$cmonth='August'};
if ($mon==9){$cmonth='September'};
if ($mon==10){$cmonth='October'};
if ($mon==11){$cmonth='November'};
if ($mon==12){$cmonth='December'};

my $date=$year.-$cmonth;

my  $imap = IMAP::Admin->new('Server'=>$mailhost,
                             'Login'=>$username, 
                             'Password'=>$password);

#Get list of Imap Folders
my  @list = $imap->list("Listserv.*");
my $listt;
foreach $listt (@list){

#Select only current folders
if ($listt =~ m/Listserv\.[a-zA-Z\-]+$/){
print "$listt.$date \n";
#my $err = $imap->set_acl($listt,"all","read","anyone","read"" );
#my $err = $imap->rename($listt, $listt.$date);
#my $err = $imap->create($listt);
#my $err = $imap->set_acl($listt,"all","append","anyone","append","cyrus","all" );

}
 }









$imap->close; # close open imap connection






-- 

                                Lance Hoffmeyer
                              [EMAIL PROTECTED]

-------------------------------------------------------------------------------
 I see you, and you see me.  I experience you,and you experience me.  I see you
behavior.  You see my behavior.  But I do not and never have and never will see
  your experience of me.  Just as you cannot "see" my expereience of you.  My
 experience of you is not "inside" me.  It is simply you, as I experience you.
  And I do not experience you as inside me.  Similarily, I take it that you do
                        not experience me as inside you.
                                       -
                                   R.D. Laing

Reply via email to