in reply to Strange regexp problem

I'm trying my best to read your regex "correctly" (resorting to "View Page Source" in my browser until you or one of the janitors puts it into <code>...</code> tags), but I think you basically have it all completely wrong... It seems to start like this:
s/(.{$len}[...
(note the square bracket) and end like this:
...])/$1<wbr>/mgi;
which means that all those backslashes, parens, curlies with digits, and vertical-bar alternations are actually inside a character class. (If you don't understand what that means, you need to spend some time with perlretut and perlre.)

To make matters worse, you even seem to be trying to use embedded square brackets, which really cannot be right -- that in itself might not be a syntax error, but it simply will not work. (The PM formatting logic turned the square brackets surrounding "a-z" into an anchor tag, which wouldn't happen if you used code tags around the code.)

So, the regex in its original form is trash. Start over. What are you really trying to accomplish? What is the input data? What is the intended output?