Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: SMTP "auth" problem after upgrade

by SimonClinch (Deacon)
on May 13, 2011 at 16:05 UTC ( #904695=note: print w/replies, xml ) Need Help??


in reply to Re: SMTP "auth" problem after upgrade
in thread SMTP "auth" problem after upgrade

Apart from the fact that $smtp is scoped out of existence and Noauth being tested for defined looks like a tautology in this snippet, I would be inclined to factorise out the "unless" in such a situation where most of the lines of code in the two branches are identical, and use a tertiary operator instead :
my $smtp = MIME::Lite->send('smtp', $host, defined( $something_else ) ? AuthUser => $user, AuthPass => $pass : Noauth => 1, Debug => 1 );

One world, one people

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://904695]
help
Chatterbox?
[karlgoethebier]: code><table style="border: 1px solid black;}"></code> same for th and td ?
[shmem]: my scratchpad
[karlgoethebier]: oops!
[shmem]: karlgoethebier: np, got it. But doesn't either :-/
[shmem]: just leaving it as is. After all, enough effort put into that. hrmpf.

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (13)
As of 2017-07-24 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (356 votes). Check out past polls.