Subject: | Incorrect rel when port was set |
The following script:
#! /usr/bin/perl -w
use strict;
use URI qw();
use vars qw($uri $base);
$base = new URI("http://test.net/cgi-bin/test.cgi");
$uri = new URI("http://test.net/cgi-bin/counter.cgi");
$_ = $uri->rel($base);
print "\$base: ".$base->canonical."\n";
print "rel: ".$_->canonical."\n";
$base->port(80);
$_ = $uri->rel($base);
print "\$base: ".$base->canonical."\n";
print "rel: ".$_->canonical."\n";
__END__
produces different results at these 2 times. I had tried to trace the code. It seems that $uri->authority returns different result before and after setting $uri->port(80). I can't read the code inside the authority method. I had better leave the solution to you.