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

Okay, so I'd just add this to the bottom of the perl script and it would send the Standard output of the script as the contents of the email?

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

    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.

      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.