Re: FAQ 6.15 How can I print out a word-frequency or line-frequency summary?
- From: Nathan Keel <nat.k@xxxxx>
- Date: Mon, 11 May 2009 12:03:54 -0700
jidanni@xxxxxxxxxxx wrote:
I saved you 2 bytes!:
--- perlfaq6.ORIG.pod 2009-05-12 01:56:38.000000000 +0800
+++ perlfaq6.pod 2009-05-12 01:57:44.706933151 +0800
@@ -539,8 +539,8 @@
in the previous question:
while (<>) {
- while ( /(\b[^\W_\d][\w'-]+\b)/g ) { # misses "`sheep'"
- $seen{$1}++;
+ while ( /\b[^\W_\d][\w'-]+\b/g ) { # misses "`sheep'"
+ $seen{$&}++;
}
}
I wouldn't use $&
.
- Follow-Ups:
- Re: FAQ 6.15 How can I print out a word-frequency or line-frequency summary?
- From: Tad J McClellan
- Re: FAQ 6.15 How can I print out a word-frequency or line-frequency summary?
- References:
- Prev by Date: FAQ 7.12 How can I tell if a variable is tainted?
- Next by Date: Re: writing get_script()
- Previous by thread: Re: FAQ 6.15 How can I print out a word-frequency or line-frequency summary?
- Next by thread: Re: FAQ 6.15 How can I print out a word-frequency or line-frequency summary?
- Index(es):