On Fri, 2008-10-03 at 16:03 +0200, Matej Cepl wrote:
> 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]);

       $imap->move($tFolder,$targetedMessages{$tFolder});
# $targetedMessages{$tFolder} already is a reference

>     }
> 
> 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
> 
> 
-- 
Just my 0.00000002 million dollars worth,
  Shawn

Linux is obsolete.
-- Andrew Tanenbaum


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


Reply via email to