Okay, code is now:
sub sendmail() { # my $to = shift; # my $fax = shift; my $to = 'anthony@currentmarketing.com'; my $fax = '/tmp/1049811816.pdf'; ### Create the multipart "container": my $msg = MIME::Lite->new( From => 'anthony@currentmarketing.com', To => $to, Subject => 'FAX for you.', Type => 'multipart/mixed' ); print "created msg\n"; ### Add the text message part: ### (Note that "attach" has same arguments as "new"): $msg->attach( Type =>'TEXT', Data =>"Here is a fax for you!\n\n:)" ); print "added text part\n"; ### Add the pdf part: $msg->attach(Type =>'application/pdf', Path => $fax, Filename => 'fax.pdf', Disposition => 'attachment' ); print "attached pdf\n"; ### Now send? $msg->send_by_smtp('216.26.151.48'); print "sent by smtp worked\n"; print "Sent $fax to $to\n"; }
But guess what? It still doesn't work, unless run via the debugger. RMGir, thanks for the advice though. Anyone else have an idea?

Here is the output when it hangs (with new prints in there):

[anthony]# ./convert2.pl created msg added text part attached pdf

--
notsoevil
--
Jeremiah 49:32 - And their camels shall be a booty. . .


In reply to Re: Runs with perl -d, but ... by notsoevil
in thread Runs with perl -d, but ... by notsoevil

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.