Use File::Spec::Functions (qw/catfile rootdir/); my $path=catfile(rootdir(),'Program Files','My Dir','myfile.exe');