#!/usr/bin/perl # #Script allows to search and copy files #Thanks to Anonymous Monk #Works only with PERL created text file!!! # #tested: --ok! use strict; use warnings; use autodie; use File::Find::Rule; use File::Slurp; use File::Basename; use File::Copy; my $startdir = shift or die Usage(); my $dirTarget = '/cygdrive/d/tmp/'; my $fnames = join '|', map quotemeta, read_file('./data/IDs_created.txt' , qw/ chomp 1 /); my @fnames = find( file => name => qr{$fnames}, in => $startdir ); copy ($_, $dirTarget.basename ("$_")) for (@fnames);