in reply to Capturing the nth word in a string
Your @{[$str =~ m/\w+/g]}[3] would be better written as ($str =~ m/\w+/g)[3]. I'd more likely write it as, my $nth = (split ' ', $str)[3]; though that's not exactly the same thing with respect to punctuation, etc. Whether that is as usable to you depends on your data.
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Capturing the nth word in a string
by Roger (Parson) on Oct 14, 2003 at 03:51 UTC | |
by ysth (Canon) on Oct 14, 2003 at 09:27 UTC |