problem is that file names with spaces cause this line to fail
Show your failing code. I suspect your directory reading code to cause the problem. Did you check that $groupFile actually holds the file name with embedded spaces? This works for me:
use File::Copy; use Cwd; my $file = 'foo bar'; my $dest = 'dest dir'; my $cwd = getcwd(); my $src = "$cwd/$file"; open my $fh, '>', $file or die "Can't write '$file': $!\n"; close $fh; mkdir $dest or die "Can't mkdir '$dest': $!\n"; copy ($src, $dest) or die "Can't copy '$src' to '$dest': $!\n";
Also, don't interpolate single variables. Don't say copy ("$groupFile","$errDir"), say copy ($groupFile, $errDir)
In reply to Re: how to copy files with spaces in name
by shmem
in thread how to copy files with spaces in name
by ric.techow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |