I have 8 csv files that need to be archived and emailed to 8 different addresses once a day
Explain this a bit more? You have 8 CSV files -- do they all go to each of the 8 addresses, or is there a correspondence between each CSV file and a particular address?

For example, let's say the CSV files are named a.csv, b.csv, et cetera. Your first recipient is john_q_public@foobar.com. Does he get all 8 csv files? Only a.csv? Some subset (i.e., John needs a.csv, d.csv, and f.csv, but no others)? The answer to that will change how to approach the hash.

Unrelated to the hashes, you can simplify part of your code. Specifically, the sys_date sub can be replaced by POSIX::strftime. At the top of your script add use POSIX then the sys_date sub call can be replaced with something like:
$file_date = POSIX::strftime("%b%d%Y", localtime);

See strftime docs for all of the available formats.


In reply to Re: Appending to filenames, system mv, using MIME::Lite and other fun by Nkuvu
in thread Appending to filenames, system mv, using MIME::Lite and other fun by hmbscully

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.