in reply to Re^2: Error while Copying files from a directory to cwd
in thread Error while Copying files from a directory to cwd

What, you don't know what operating you are running?

At any rate, you may or may not have read that tutorial I listed by now but for anybody else lurking around as Anonymous you might consider doing this to see for yourself what might be wrong:

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_m +s'; 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::na +me : $! " . 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/oth +er at (eva l 24) line 20.

I ran this code like this C:\Temp\abba>perl  runall.pl ./other which means that somewhere somebody moved me down into the target folder. If you run this with the argument to the script as the FULL file path however c:/temp/abba/other the code runs as expected.