On Tue, 30 Apr 2002, Vitor wrote:

> use strict;
> use Mail::CClient qw(set_callback);
> set_callback (login=> sub { return ("login","password"); } )

I don't see any reason why this shouldn't work.  Acmemail (which runs fine 
under mod_perl) uses Mail::CClient with callbacks without problem.

> I think this is related with the cacching feature of mod_perl that need to
> be disabled for pages that uses these callbacks.

What are you expecting to happen here?  When Mail::CClient needs a login 
it will call the anonymous subroutine passed on login which will simply 
return the two values "login" and "password".  These need to be set to the 
login and password of your POP/IMAP/Whatever account.

You could be getting things confused with closures here, it's reasonably 
easy to do.

  sub init
  {
     my $login,$password;
     set_callback (login=> sub { return ($login,$password); } )
  }

Will not login no matter what you set $login or $password to be later as 
the anonymous subroutine will be bound to the particular $login and 
$password created in init.

Hope this is helpful (and the problem isn't more serious)

Mark.

-- 
s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}

Reply via email to