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
In reply to Re^6: instantiating an smtp object
by haukex
in thread instantiating an smtp object
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |