I have a script for archiving email messages on IMAP (whole code 
is available at 
http://mcepl.fedorapeople.org/tmp/archiveIMAP.pl). I go through 
all messages in one source folder and put all of those which 
I want to archive to hash indexed by the target folder:

...
$targetFolder = getTargetFolder($folder,$msgYear);
push ( @{ $targetedMessages{$folder} } , $msg);
...

and then just go through the hash and actually move all messages 
which should go to one target folder:

    foreach my $tFolder (keys %targetedMessages) {
        if (!($imap->exists($tFolder))) {
            $imap->create($tFolder)
                or die "Could not create $tFolder: [EMAIL PROTECTED]";
        }
        $imap->move($tFolder,[EMAIL PROTECTED]);
    }

EPIC complains about the @-sign in the last line of this snippet 
-- that I should use $-sign when trying to slice the array. But 
I am not trying to slice an array (at least I hope). Just 
following perldsc(1) I am trying to get whole array and use it as 
a parameter of the method move.

Who's wrong? Me or EPIC?

Thanks for any advice,

Matěj Cepl


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to