in reply to Deleting folders based on name.
my @FullDirPaths = map{"$hipath/$highfolder/$_"}@LowFolders;
You might want to look at Date::Time module for comparing dates. Or you could make a little YYYYMM "date math" routine yourself, but I suspect that using the module will be easier.
Don't know if this is a typo or not, but don't put a ";" after the "->" ie have "->new();"
Update: Don't know where my brain is this morning...Actually I don't think that you need to save the @FullDirPaths like above at all. At this point in the code you have all 3 parts of the full path: "$hipath/$highfolder/$lowfolder". Just decide right there whether or not you should delete this particular $lowfolder or not! No need to save the names to process later. You can use a simple regex to separate out the month and year from the filename like shown below...
my @dates = ( '1010', '1007'); foreach my $date (@dates) { my ($year,$mon) = $date =~ m/\d\d/g; print "year = $year month= $mon\n"; }
|
|---|