http://www.perlmonks.org?node_id=385936


in reply to File::NCopy Problem

It would help tremendously if you at least specify on which platform you're working. Also, I'd like solutions to all my problems too, but I'm afraid I'm not going to get them.

But, I'm in a good mood as it's the birthday of my mother-in-law, so I'll provide a workaround which works at least on Linux and Apple OSX. You can use spaces in file/directory names by escaping the space characters with a backslash.

#!/usr/local/bin/perl use strict; use warnings; use File::NCopy qw(copy); my $src = "Dir With Spaces"; my $dst = "Target_Dir"; # Escape whitespace characters $src =~ s/(\s)/\\$1/g; # Copy recursively copy \1, $src, $dst;

Arjen

Update:Fixed bug in regex