use File::Spec::Functions; my ($path) = catfile($var1, $var2, $var3);