halfcountplus has asked for the wisdom of the Perl Monks concerning the following question:
while (<DATA>) { if ($_ =~ /this/) { my $c=the number of times "this" occured print "$_\nthis matched: $c times" } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: counting matches in a line
by FunkyMonk (Bishop) on Mar 16, 2008 at 17:06 UTC | |
by halfcountplus (Hermit) on Mar 16, 2008 at 23:33 UTC | |
|
Re: counting matches in a line
by pc88mxer (Vicar) on Mar 16, 2008 at 17:05 UTC | |
|
Re: counting matches in a line
by halfcountplus (Hermit) on Mar 16, 2008 at 17:03 UTC |