http://www.perlmonks.org?node_id=111383


in reply to Net::SMTP_auth

A few things confuse me. Is there a better way to do auth_types() without the symbolic reference?

Also, you return a lot of failures. Why not leave off some else blocks and just have a return; at the end of each function? (If you want to agree with the documentation, don't return undef explicitly. It creates a one-item list in list context, not a blank list.)

Do you really need a regex to compare $auth_type?

Why are you using a string comparison for numbers in auth()? Further, why not call $me->code() once, storing it in a temporary variable?

Otherwise, things look solid. (Your _AUTH() is evidence that you're a good programmer.)

Replies are listed 'Best First'.
Re: Re: Net::SMTP_auth
by projekt21 (Friar) on Sep 10, 2001 at 18:17 UTC
    Thanks for reply, I'll take your advices into my revision. But the _auth() is JUST evidence that I read G. Barr's code very closely, I did not do this myself. The flowers belong to him.