我有如下的目录结构。
- 我想在我的@project得到公正的项目名称。
@project=('project1','project2')
; - 我想排除
OLD
目录及其子目录@project
- 我想获得最新的文件中的子目录中的所有项目
@project
。 即,对于project1
,最新的文件是在子目录2014
,这是foobar__2014_0916_248.txt
我怎样才能编一套规则来实现这一目标?
use strict;
use File::Find::Rule;
use Data::Dump;
my $output = "/abc/def/ghi";
my @exclude_dirs = qw(OLD);
my @projects = File::Find::Rule->directory->in("$output");
dd \@projects;
我的迪尔结构:
.
├── project1
│ ├── 2013
| ├── file1_project1.txt
│ └── 2014
| ├── foobar__2014_0912_255.txt
| ├── foobar__2014_0916_248.txt
├── project2
│ ├── 2013
| ├── file1_project2.txt
│ └── 2014
| ├── foobarbaz__2014_0912_255.txt
| ├── foobarbaz__2014_0916_248.txt
└── OLD
└── foo.txt