use File::Copy; copy("a/b/*.txt","a/"); #### use File::Copy; my @list = ; foreach my $file (@list) { copy($file,"a/"); }