use File::Spec::Functions; print catfile(rootdir(), qw(foo bar baz), 'test.txt'); # /foo/bar/baz/test.txt # This is perl, v5.8.8 built for i686-linux