Re: URI::URL::rel difficulty
Harald Joerg (Harald.Joerg@mch.sni.de)
Thu, 08 Jan 1998 12:42:48 +0100
James Garrison wrote:
> [...] I run into problems because
> when URI::URL::rel is executed, it does
> not correctly (IMHO) handle cases where
> the given URL diverges from the base at
> the root. For example:
>
> $BASE = http://host.domain.com/aaa/bbb/ccc/
> $URL1 = http://host.domain.com/aaa/bbb/ddd/xx.html
> $URL2 = http://host.domain.com/xxx/yyy/zzz/ww.html
>
> $URL1->rel($BASE) produces ../ddd/xx.html (correct)
>
> However,
>
> $URL2->rel($BASE) gives ../../../xxx/yyy/zzz/ww.html
>
> instead of the more logical /xxx/yyy/zzz/ww.html
>
> What do you think?
I think that the result of URI::URL::rel is correct.
If I use the rel function, I do so because I want to
move a whole tree or to copy it e.g. onto a CD. You
can't use /xxx/yyy/zzz/ww.html notation there, but
../../../xxx/yyy/zzz/ww.html will work regardless of
the path (or directory) to which the tree is moved.
--
Oook,
--haj--