I'm new to Perl and the only real experience I've had with it has been self-taught through a beginners book. I recently was asked to do a script that will perform certain functions in a windows directory, and was hoping I could get a little help. Here's what its supposed to do:

Monitor and scan a windows directory daily and see if any files are older than 5 days. If they are then the script should log the files in a blank text document and delete them from the directory.

You can see what I have so far on my public scratchpad. I'm sure it looks pretty bad, but like I said, I just started learning. I could still use some help with the pieces I'm missing, as well as any clean up I can perform. Any advice you guys can give me would be much appreciated. Thank you.

In reply to script that logs and deletes old windows files by Perl Noob

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.