sweetblood has asked for the wisdom of the Perl Monks concerning the following question:
This script here illustrates the issue, using komodo and strawberry perl. When I simply run the script it does all that I ask it to ie: I get my email, but I also get the error listed at the bottom. If however I break on the first eval in the function then run from there I get no error. Again, the script does run to completion either way.
Any ideas?Error Use of uninitialized value in subroutine entry at blib\lib\Net\SSLeay.pm (autosplit into blib\lib\auto\Net\SSLeay\randomize.al) line 924.#!/usr/bin/perl -w use strict; use MIME::Lite; use File::Basename; sendmail('someuser@foobar.com', "Foo", "bar\n"); sub sendmail { my ($recipients, $subject, $msg) = @_; my ($me) = basename($0) =~ /^([^\.]*?)\./; my $mailhost = 'mail.foobar.com'; my $fromAddress = $me . '@foobar.com'; $msg =~ s/[\r\n]//g; my $type = ($msg =~ /\n/) ? 'text/plain' : 'text/html'; eval { $msg=MIME::Lite->new( To => "$recipients", From => "$fromAddress", Subject => "$subject", Type => $type, #'text/html', Data => "$msg" ) or warn "new $!"; }; do { warn 'MIME::Lite->new() - ' . $@; return 0; } if $@; eval { MIME::Lite->send('smtp', "$mailhost") or warn $!; $msg->send() or warn "sending $!"; }; do { warn 'MIME:Lite->send() - ' . $@; return 0; } if $@; 1; }
Sweetblood
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME::Lite ssleay error
by Mr. Muskrat (Canon) on May 26, 2016 at 18:56 UTC | |
by sweetblood (Prior) on May 26, 2016 at 19:29 UTC |