$str = 'yo ho ho and a bottle crumbs. hangin and bangin in the upper-class slums.'; print join ' ', (split /\s+/, $str)[0..4];