in reply to Appending values to variable.
You could use join
$newpath=join("\",@dirs);
or not use split in the first place and instead replace the slashes directly
$filepath=~s{/}{\\}g;
But note that usually when dealing with filepaths it is better not to manually munge but use the appropriate modules for that (see perldoc perlport and perldoc File::Spec for more).
|
|---|