> # ---
> use Cyrus::IMAP::Admin;
> while (1) {
>     my $client = Cyrus::IMAP::Admin->new("localhost");
>     my $rc = $client->authenticate(
>             -mechanism  =>  "login",
>             -service    =>  "imap",
>             -user       =>  "foo",
>             -password   =>  "bar",
>     );
>     print " authenticate NOK " unless $rc;
>     print STDERR ".";
>     select(undef, undef, undef, 0.1);
> }
> # ---

I may be dense but wouldn't this code allocate 
a new Cyrus::IMAP::Admin object each pass through
the loop and the reference to the new object be 
stored in the same location as the reference to 
the instance from the previous iteration?

Wouldn't a better approach be to create a new object
before the loop, then open/close the connection
each time you passed through the loop?

-- Michael --

Reply via email to