use File::Xcopy; my $obj = File::Xcopy->new; # copy all the files with .txt extension if they exists in /tgt/dir $obj->xcopy('c:/TEMP', 'c:/temp2', '\.txt$');