Assuming you're using something smart to get all the links (HTML::Parser or linkextractor), why not then just use
URI's method to construct a 'base url', since that seems to be what you're trying to do.
my $base_uri = 'http://page.tld/im/spidering';
my @links = get_links($base_uri);
for( @links )
{
my $new_base = URI->new_abs($_,$base_uri);
}