#!/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/");