in reply to Year-month for file names
Are you looking for a rolling 12 month window? Ie, if we were in October now, would you be looking for the last two months in 2012?
sub filenames { my( $base, $year, $month ) = @_; return ( ( map { sprintf $base, $year-1, $_ } $month+1..12 ), ( map { sprintf $base, $year, $_ } 1..$month ) ); } print filenames "file_name_%04d%02d\n", 2013, 11;
Pls see the trailing "\n" in the filename template which is there only for the printing.
|
|---|