I think you've misunderstood the tr/// operator there Sean.
tr///, despite how it looks, has nothing to do with regexps, so it doesn't support character classes. This means that it doesn't understand \W (since it's not a valid escape sequence. Turn on warnings if you don't believe me) and treats it as a W. Similarly, [ and ] are just treated as literal characters.
Also, there's no need to escape the '.' in the replacement, as it's interpreted as a literal '.'.
Therefore, the code you posted will replace any character that is not (that's the /c) a '[', a 'W' or a ']', which happens to do what's required in the example used.
I hope that clears some thing up.
As for the question at hand, here's a suggested solution, which will work for any string that is formatted like "name=value", turing the 'value' into an equal number of dots:
Code:
my $alt = 'alt=testx';
$alt =~ s/(?<==)(.+)$/'.' x length($1)/ge;
print "$alt\n";