good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: the best way to separate a string into wordsby Tanktalus (Canon) |
on Jan 20, 2009 at 00:13 UTC ( [id://737429]=note: print w/replies, xml ) | Need Help?? |
Generally, I use Text::ParseWords. But that's because I like the option for the user to pass in word "some phrase" word to get only three "words" out of it, basically allowing a form of escaping on spaces that makes sense. This isn't a whole lot more complicated than using split ' ', $string, but offers huge amounts of extra flexibility. Whether you do this or not is dependant on whether you want that flexibility or not.
In Section
Seekers of Perl Wisdom
|
|