in reply to How do I split a string at a char position that's also the end of a word?

The problem is that \b matches a location, and not actual text. I have a feeling you'll want to write something like:
s/(.{0,80})\b/$1\n/g for @file;
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.

_____________________________________________________
Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

  • Comment on Re: How do I split a string at a char position that's also the end of a word?
  • Download Code