in reply to Re^7: parsing CSV
in thread parsing CSV

I apologize for my lack of knowledge in this area. I'm a complete novice in perl. I've been reading the MIME documentation. I see how to set up mail. The thing that isn't clear to me is how I would use MIME in the script above to email the scripts output. What I'm not getting is how to pipe the output of the script into an email body.
The only experience I've had in mailing output is by setting variables to urls and then curl that variable

Replies are listed 'Best First'.
Re^9: parsing CSV
by Corion (Patriarch) on Oct 07, 2016 at 14:30 UTC

    Usually, you have the output you want to mail in a variable, and then use code that is quite similar to the SYNOPSIS section of MIME::Lite to send the mail.

    Basically instead of wherever you have print in your code, you could use

    $output .= "whatever...";

    to append to the variable $output.

    When you feel ready to send the mail, create the MIME::Lite object and send the mail according to the SYNOPSIS section of MIME::Lite, giving the Type as TEXT and the Data as $output.