in reply to Re: Help with regex using variables
in thread Help with regex using variables
Similarly, I would use File::Spec to construct the paths and do away with all the escaping which will be taken care by Perl in a portable way:
use File::Spec; my $path = File::Spec->catfile("C:", "Dir1", "Dir2", "Dir3", "KeepMe") +; my $base = File::Spec->catdir("C:", "Dir1", "Dir2", "Dir3"); # or my $base = File::Spec->catdir("C:", "Dir1", "Dir2", "Dir3"); my $path = File::Spec->catfile($base, "KeepMe");
|
---|