XP is just a number | |
PerlMonks |
Re: How do you place words from a sentence into an array?by gaal (Parson) |
on Oct 26, 2004 at 16:34 UTC ( [id://402692]=note: print w/replies, xml ) | Need Help?? |
Everybody said split, but note that if you have some punctuiation, you may be disappointed; for this sentence, for example, $words[2] is "split,".
You must have heard of CPAN: it has lots of modules. Lingua::EN::Splitter is one that (if you're looking for a real-world solution) can help you here. Of course, split *is* useful to know! But when it comes to human language, problems are often more complex than you think.
In Section
Seekers of Perl Wisdom
|
|