use File::Spec; $dir1=catdir(rootdir(),$ver,$client,"qa"); # and for copy $old=catfile($dir,$file); $new=catfile($dir1,$file);