in reply to File::Copy and wildcards
See Path::Tiny it uses File::Copy
#!/usr/bin/perl -- use strict; use warnings; use Path::Tiny qw/ path /; for my $file ( path('.')->children(qr/.txt$/i) ) { $file->copy("DIR1/"); } path("one.txt")->copy("DIR2/"); [download]