fadingjava has asked for the wisdom of the Perl Monks concerning the following question:
Also when i extract the text from database into a variable and do it this way@single = qw(I sit here and think- what the-hell am i doing with perl?); foreach (@single) { $_=~ s/([^A-Za-z0-9-])//i; }
it only returns the variable name "a". how can i get the value of the variable there? i want it to return single words in the text contained in $a. how can i do this?? alternatively, if i have to extract single words from a text (excluding punctuation marks), how do i do it?$a= "I sit here and think- what the-hell am i doing with perl?" qw($a);
janitored by ybiC: Retitle from atrocious "HELP WITH REGULAR EXPRESSIONS!!!!!!"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split a string into individual words
by pzbagel (Chaplain) on Feb 06, 2004 at 01:11 UTC | |
|
Re: Split a string into individual words
by Roger (Parson) on Feb 06, 2004 at 00:21 UTC | |
by pzbagel (Chaplain) on Feb 06, 2004 at 01:14 UTC | |
by Roger (Parson) on Feb 06, 2004 at 01:21 UTC | |
|
Re: Split a string into individual words
by zentara (Cardinal) on Feb 08, 2004 at 14:18 UTC |