use File::Spec; use strict; use warnings; my $dir = 'c:/temp'; my $file = 'tempfile'; my $path = File::Spec->catfile($dir, $file); print $path, "\n";