in reply to Re^2: Word incidence count
in thread Word incidence count
No. But indeed it is implictly assuming that the string to be matched is in $_ which is where it usually is in my code, but which is not the case for the OP's example, actually. But the cure is really lightweight, however:Shouldn't that be @words =~ /\w+/g; ?my @words = /\w+/g;
@words = $string =~ /\w+/g;
Which of them is faster depends on the data.Please note that I didn't speak of speed. I was talking about the conceptual terseness of the concept of saying what it is that you want as opposed to that of saying what it is that is not among the stuff that you do not want.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Word incidence count
by holli (Abbot) on May 17, 2005 at 08:42 UTC |