It's unfortunate that the eval ...; if ($@) ... idiom is still very prevalent, there are many examples in the literature and even the eval docs use it! However, the issues I linked to previously have been around for a long time and even though Perl 5.14 fixed some of the major issues, as far as I have read the fixes are not perfect yet. The idiom eval { ...; 1 } or ... at least allows for reliable detection of when eval failed, even when $@ gets clobbered.
As for $! vs. $@, I had a look at the source of Net::SMTP's new and it seems that $@ is explicitly set there.
Regards,
-- Hauke D
In reply to Re^4: instantiating an smtp object
by haukex
in thread instantiating an smtp object
by Aldebaran
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |