In Perl, working with a paragraph of text in one large long line without line breaks, how can I use split and RegEx (or something else) to split the paragraph into pieces of approximately the same size at the word boundary, to display in a monospaced font?
For example, how to change this:
"When you have decided which answer is the most helpful to you, mark it as the accepted answer by clicking on the check box outline to the left of the answer. This lets other people know that you have received a good answer to your question. Doing this is helpful because it shows other people that you're getting value from the community."
in it:
"When you have decided which answer is the most \n"
"helpful to you, mark it as the accepted answer \n"
"by clicking on the check box outline to the \n"
"left of the answer. This lets other people \n"
"know that you have received a good answer to \n"
"your question. Doing this is helpful because \n"
"it shows other people that you're getting \n"
"value from the community.\n"
Thanks Ben
BG100 source
share