Hmmm ... not that i know of but what's your concern? Is the data computed on the fly or in files? If its files and you're worried about memory consumption, don't be. Using MIME::Lite, a snippet such as this:

#!/usr/bin/perl -wd # use MIME::Lite; ### Create a new multipart message: $msg = MIME::Lite->new( From => 'foo@bar.com', To => 'bar@foo.com', Subject => 'A message with 2 parts...', Type => 'multipart/mixed' ); $msg->attach( Type => 'TEXT', Data => "Here's the file you wanted" ); $msg->attach( Type => 'text/plain', Path => 'baz.txt', Filename => 'baz.txt', Disposition => 'attachment' ); $msg->send;

is pretty efficient. The file is not processed until the send method is called and then it's pushed across the sendmail pipe (or whatever mailer your using) in 2K chunks

-derby

update: looking at the MIME::Lite code, it would be trivial to implement a callback feature. You need to modify the build method to not reject the key and the print_simple_body method to utilize the callback. Then you could do something like this:

$msg->attach( Type => 'text/plain', Path => 'foo.txt', Filename => 'foo.txt', Disposition => 'attachment', Callback => \&hashit, ); $msg->send; sub hashit { print STDERR "#"; }

In reply to Re: Sending mail with a callback to track progress by derby
in thread Sending mail with a callback to track progress by zentara

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.