use File::Spec::Unix; use URI; my $uri = URI->new( $base ); $uri->path( File::Spec::Unix->catfile( $uri->path, 'foo.html' ) );