URI::URL::rel difficulty

James Garrison (jhg@austx.tandem.com)
Wed, 07 Jan 1998 17:25:42 -0600


package URI::URL;
$VERSION = "4.13";   # $Date: 1997/12/12 09:54:32 $

I'm trying to write a script to clean up
a web hierarchy that was coded using all
absolute URLs.  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?

-- 
James Garrison			mailto:jhg@austx.tandem.com
Tandem Computers, Inc
14231 Tandem Blvd, Rm 1038	Phone: (512) 432-8455
Austin, TX 78728-6699		Fax:   (512) 432-8247