bug in URL::URL class

Marc Unangst (mju@cs.cmu.edu)
Mon, 03 Jun 1996 12:15:21 -0400


If you create a URI::URL object for a URL with a fragment, and then
delete the fragment by calling frag(""), the stringified version of
the URL still contains a "#".  For example, this program:

#!/usr/pdl/bin/perl5

use URI::URL;

{
    $url = new URI::URL 'index.html#foo', 'http://www.cs.cmu.edu/~mju/';

    print "before: url->frag = ", $url->frag, "\n";
    print "before: url->abs = ", $url->abs, "\n";

    $url->frag("");

    print "after : url->frag = ", $url->frag, "\n";
    print "after : url->abs = ", $url->abs, "\n";
}

generates this output:

mju@ladyburn:.pdl21/src/webindex> ./test.pl
before: url->frag = foo
before: url->abs = http://www.cs.cmu.edu/~mju/index.html#foo
after : url->frag = 
after : url->abs = http://www.cs.cmu.edu/~mju/index.html#
mju@ladyburn:.pdl21/src/webindex> 

	-Marc