in reply to Regex: get first N characters but break at whitespace

If you want the first 200 characters stopping stopping at whitespace, something like this should do the job...
($text) = $var =~ /^(.{200})(?:\s+\w*)?/s; print $text.$/;
This saves what is captured in the first set of parentheses into $text, and the match is the first 200 characters until it hits some whitespace followed by what looks like a word. I'm sure you could probably use some of perl's extended regexp capabilities, but that seems to do the job.
HTH

broquaint

Update: apparently you can ;o)