use File::Spec; my $path = File::Spec->catfile(qw(dir file.txt));