perl -wle ' use URI; my $uri = URI->new_abs("../foo/bar/baz.html", "http://www.foo.de/"); print $uri->canonical; '