in reply to Net::SMTP halts script
According to the documentation, on failure new returns undef and $@ contains an appropriate error message. This seems to work as advertised for me:
19:50 >perl -MNet::SMTP -wE "my $smtp = Net::SMTP->new('invalid'); say + 'Next'; if (defined $smtp) { say 'SMTP defined' } else { say 'SMTP u +ndefined'; say $@; } say 'Still alive';" Next SMTP undefined Net::SMTP: Bad hostname 'invalid' Still alive 19:50 >p5u v Net::SMTP Net::SMTP C:\Perl\Strawberry\strawberry-perl-5.20.0.1-64bit-PDL\perl\lib +\Net\SMTP.pm: 2.33 19:50 >
Are you using an old version of the module? Are you sure it’s Net::SMTP->new() that’s causing the crash? Please give a minimal but self-contained script demonstrating the problem, together with the exact error message(s) that result.
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::SMTP halts script
by jellisii2 (Hermit) on Jul 23, 2014 at 11:23 UTC | |
by Anonymous Monk on Aug 18, 2014 at 14:01 UTC | |
|
Re^2: Net::SMTP halts script
by Anonymous Monk on Aug 18, 2014 at 14:00 UTC | |
by Athanasius (Archbishop) on Aug 19, 2014 at 03:13 UTC | |
by nperrins (Initiate) on Aug 19, 2014 at 19:02 UTC |