This is amazing, the more I learn about this stuff, the more I'm starting to like it. Started with a 'task' which I didn't really want to do (bit out of my comfort zone), but ended up wanting to learn more and more about this new world. Well, new to me obviously.

Thank you very much for all the tips. I'll include the code I eventually ended up with. I think it's as short as it can possibly be and a lot of the suggestions are not included, this is because I like these things short, clean and clear (always try to do this with SQL too, with which I have more experience).

Might include some kind of logging if it goes wrong at some point, but I can't see this doing weird stuff as the applications that use these folders do what they're supposed to do.

#!perl -w # # Archiver for processed EDI messages # - move all messages to existing subfolder *\yyyy\mm\dd use strict; use warnings; use Time::Piece; use File::Copy; my $base = 'D:\\Some\\Specific\\Folder\\'; # The source folder my $to = $base.localtime()->ymd ('\\')."\\"; # The destination folder foreach my $file (glob qq($base\*.txt)) { File::Copy::move $file, $to or warn "Can't move $file to $to : $ +!"; } # The actual move exit 0; # The graceful ending

In reply to Re: Wildcards for a wide array of strings? by zarath
in thread Wildcards for a wide array of strings? by zarath

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.