good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^3: Display shortened paragraphby graff (Chancellor) |
on Feb 01, 2006 at 07:00 UTC ( [id://526985]=note: print w/replies, xml ) | Need Help?? |
Since people have shown how the use of a regex approach tends to be slower, here's a way to observe word boundaries (well, spaces between words, anyway) without using a regex:
The rindex function, like substr, is faster than a regex match.
In Section
Seekers of Perl Wisdom
|
|