# Append a '/' to directories if needed if ($target_dir ~! m{\/$}) { $target_dir .= '/'; } if ($tmp_dir ~! m{\/$}) { $tmp_dir .= '/'; }