in reply to Re: sending email using Email::Send
in thread sending email using Email::Send

Hmm, so
sub DESTROY { $SMTP->quit if $SMTP; }
doesn't get executed (?in time)?

Replies are listed 'Best First'.
Re^3: sending email using Email::Send
by tirwhan (Abbot) on May 09, 2008 at 12:51 UTC

    No, it doesn't appear to be, adding a warning statement to the DESTROY block in Email::Send::SMTP does not result in any output.

    I'm pretty sure it's not a timeout issue either, because doing a tcpdump trace of the net traffic shows the script sending a TCP FIN packet (so it's actively closing the connection, not hanging).


    All dogma is stupid.
      Making $SMTP a file scope lexical (my) would probably fix that.

        Nope, doesn't. And to be honest I don't see how changing $SMTP's scope would have anything to do with the execution of the DESTROY block (the warning I added was independent of $SMTP's content).


        All dogma is stupid.