use Modern::PBP::Perl; use File::Find::Rule; my $path = 'C:\My\Path\to\files'; my $exclude = '^\._'; my $rule = File::Find::Rule->file->not_name(qr/$exclude/)->start($path); while ( defined ( my $file = $rule->match ) ) { say $file; }