$message is a reference ... $pop->list probably returns a hash reference ...
%$message is dereferencing the reference so the whole thing (%$messages)
becomes a hash ... hope this helps (hope I understood your question!)

On Tue, Aug 14, 2001 at 07:31:15AM -0700, John Sands shaped the electrons to read:
> I copied some code to get POP mail:
> 
>  my $pop = Net::POP3->new($mail_server) or die "Can't open connection to
> $mail_server: $!\n";
>  defined($pop->login($mail_username, $mail_password)) or die "Can't login to
> $mail_server, $mail_username, $mail_password: $!\n";
>  my $messages = $pop->list() or die "Can't get list of messages from
> $mail_server: $!\n";
> 
> It works. I iterate the list of messages with this loop:
> 
>  foreach my $msgnum (keys %$messages) {
>  }
> 
> This works as well. But I don't understand the use of the hash. Why isn't it:
> 
>   %messages = $pop-list()
> 
> and:
> 
>   foreach my $msgnum (keys %messages) {
>   }
> 
> What does %$messages mean?
> 
> Thanks
> John Sands
> 
> __________________________________________________
> Do You Yahoo!?
> Make international calls for as low as $.04/minute with Yahoo! Messenger
> http://phonecard.yahoo.com/
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to