use strict; use warnings; use File::Copy; use File::Find; use Cwd qw|cwd|; my $modem_build_ms = 'I have no clue what should go into model_build_ms'; my $modem_build_location; my $dir=$ARGV[0]; my $currdir = Cwd::cwd(); print $dir; opendir(DIR, "$dir") || die "Error in opening dir $dir $!"; #die "Bad directory" unless (-d $dir); print "\n$modem_build_ms\n"; my %files = map {$_ => 1} qw(data.txt datascript.pl); find(sub { copy($File::Find::name, $currdir) or die "Can't cp $File::Find::name : $! " . Cwd::cwd() if delete $files{$_}; }, $dir); close DIR; __END__ Notice how the output says this: I have no clue what should go into model_build_ms Can't cp ./other/data.txt : No such file or directory C:/Temp/abba/other at (eva l 24) line 20.