most people agree this is a DWIM violation: this is an area where Larry blew it
It may not be a DWIM for you, but it's a DWLM (do what Larry means), and that's the only meaning that matters. In fact, I don't think it would look right for it to return the changed string. I like that I can use it as:
if (s/foo/bar/) { # yes, I replaced foo with bar
...
}
So, it certainly DWIMs for me.
Right, that's a point, but the way I look at it it would still work even if
s/// was returning the changed string (except, of course, when the returned string was something like zero or an empty string).
So the actual behavior does a slightly better job of DWIM in one case, and a worse job in another case... (and now that I think of it, why not return the string in list context and the count in scalar. Wouldn't that cover both bases?).
Update: actually, there's another problem I haven't thought about -- if you're doing a map{ s///; $_ } you've got the string passed through map even if there's no match. If you had s/// return the string *only* if it were changed, then you could do an if(s///) with it (usually) but you'd probably end up a sticking a $_ on the end of your map blocks anyway, just to get the string passed through in the no match condition.
s/where Larry blew it/where Larry's brilliance is more difficult to perceive/