Why do you want to force line wrapping of text w/
<br>'s here on PM? It wraps text nicely already by letting it get handled as HTML, and code is wrapped at a user-defined line length...
What's an example of a node or two where you find this useful?
couple TWTOWTDI code comments:
- The print might as well just be print $/x3, $_, $/x3 (for fun, print join $_, ($/x3)x2; works too).
- The regex can be simplified a little (though i found your way clear as well) to be .{75,}?\s
- also w/the regex, i think that, since this is HTML, the \s should be outside of the capture, so the BR actually replaces the whitespace character.
- summary: perl -e '$_=<>;s/(.{75,}?)\s/$1<br>/gs;print$/x3,$_,$/x3'