Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Its just avoiding grep; again a trivial soln. cool, I know that u r c00l and all, but could u plz stop im-talking? Many find it plain annoying and it hinders communication between people here. It is appropriate where it is appropriate, that is in IMs et simila, in which case your primary goal is speed and not clarity. But here it's just the opposite.
Initialization and "efficiency" issues apart, which were duly pointed out by davido, just reasoning solely in terms of user interaction, what benefit could come of incrementally printing the counter at each iteration? You're only interested in the final value anyway. Not to mention the /foo/ gotcha mentioned several times in this thread. But it can be done using spl variable of reg ex also, if I am right?? Any takers? cool, I know that u r c00l and all, but could u plz stop im-talking?
That is just like my $str="@arr"; that is, unless you've changed $". And if you haven't then it's a very convenient idiom. If you have, then you should have done so locally in a block anyway, unless yours is a very very special situation.
That is just like "@arr" =~ /foo/; no need for an intermediate variable.
I understand what you mean, but:
In reply to Re^2: Word frequency in an array
by blazar
|
|