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

The common approach is to read the documentation of a module instead of guessing what it does.

If you want to blindly mail the standard output of a script, consider piping its output into the mailx or sendmail program.

Replies are listed 'Best First'.
Re^8: parsing CSV
by younggrasshopper13 (Novice) on Oct 07, 2016 at 14:25 UTC
    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

      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.