My overall first impression is that this is pretty good code - subdivided into subroutines, nicely formatted, etc. It could be compacted / made mode "Perlish" in a couple places, but because TIMTOWTDI and the code is still clean and pretty easy to follow, I think it's fine the way it is. Just a few other issues / comments:
- Most importantly, you're using the system function with a single argument and with user input (command-line arguments), which is vulnerable to injections, and you're not checking the calls for errors. See Calling External Commands More Safely for alternatives.
- opendir also needs to be checked for errors, and it's better to use lexical file/dir handles, as in opendir(my $dh, $path) or die "$path: $!";.
- Instead of your sub pad, you can use sprintf, as in sprintf("%02d", $num).
- I would suggest you take the time to study Time::Piece and/or DateTime instead of the basic localtime stuff you're doing here, I think you'll be much happier in the long run.
- You may also want to consider looking into Getopt::Long to pass arguments to the script instead of a plain list of arguments. IMHO it makes for much more readable script invocations.
- Unless you're certain this will only ever be run on *NIX, you probably want to consider using a module for your filename manipulations. Personally I like Path::Class.
- Now we're getting very nitpicky, but do you really need to provide two different date formats? For things like this I'd always stick to YYYY-MM-DD.