in reply to How do I split a string at a char position that's also the end of a word?
This will match up to 80 (non-newline) characters, and try to match a word boundary after them. If it can't, it'll back up one character and try again.s/(.{0,80})\b/$1\n/g for @file;
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
|
|---|