in reply to Re^5: instantiating an smtp object
in thread instantiating an smtp object
I'll admit that I've never personally encountered the eval/$@ bug in the wild (yet), and the code in question does say use 5.014;. But, although admittedly unlikely, it's not impossible that Net::SMTP might someday update its DESTROY method with some code that still exhibits a form of the bug, or that the use 5.014; statement is removed later and the code is run on a lower version of Perl, or that the code is copy-and-pasted and used somewhere else where the bug suddenly shows up, and so on. So I still think that eval { ...; 1 } or ... is "better" (more reliable at detecting eval failures) than eval { ... }; if ($@) ..., and that it's a good habit to get into.
Regards,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: instantiating an smtp object
by $h4X4_|=73}{ (Monk) on Jun 07, 2016 at 08:22 UTC |