in reply to Re: substr questionin thread substr question
That's the way I'd go too, but there's a little problem in your implementation:
$ perl -le'print "abc def" =~ m[(^.{0,100})\s]' abc [download]
m[(^.{0,100})(?!\S)] [download]
m[(^.{0,100})(\s|$)] [download]