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.)