>>match(/([^\s]+(\s+|$)){0,10}/)[0]+($'>""?"...":"")

This is a good way, seriously, for a Perl programmer moving to Ruby to
maintain job security.

Ruby is using the tactic, "embrace and extend."