I think you are assuming that the parentheses around the regular expression induce a list context on it. That it not the case. The left of the assignment operator determines the context, and it is scalar. In scalar context, s/// returns the number of successful substitutions. Putting parentheses around the declared variable variable makes it do what you want it to do, because it makes for a list context.
This:
my ($string) = $webpage =~ s/^$domain//;
Would return the matches part of $webpage: the domain name. This is probably not what you want. You either want S.Mark's code:
$webpage =~ s/^$domain//;
my $linkFromRoot = $dbh->quote($root . $webpage);
Or this
my ($string) = $webpage =~ /^$domain(.+)$//;
my $linkFromRoot = $dbh->quote($root . $string);