in reply to Re: instantiating an smtp object
in thread instantiating an smtp object
Regarding the idiom eval ...; if ($@) ..., see for example Bug in eval in pre-5.14 or the "Background" section in Try::Tiny. The better idiom is eval "...; 1" or handle_error($@). And in this case I'd suggest eval BLOCK instead of eval STRING so that syntax errors can be caught at compile time.
Also, in "say "Unable to connect to '$host'. $!"", I think that should be $@ instead of $! (at least per the documentation of Net::SMTP).
Regards,
-- Hauke D
Update: s/patter?n/idiom/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: instantiating an smtp object
by $h4X4_|=73}{ (Monk) on Jun 06, 2016 at 11:21 UTC | |
by haukex (Archbishop) on Jun 06, 2016 at 11:50 UTC | |
by $h4X4_|=73}{ (Monk) on Jun 06, 2016 at 14:27 UTC | |
by haukex (Archbishop) on Jun 06, 2016 at 15:03 UTC | |
by $h4X4_|=73}{ (Monk) on Jun 07, 2016 at 08:22 UTC |