in reply to Re: Counting words
in thread Counting words

 $count += () ... kind of an idiom

I've always hated that idiom. It's so satanic.

#!/usr/bin/perl use strict; use warnings; my $COUNT = 0; while(<DATA>){ $COUNT++ while m{\b\w+\b}g; } die "COUNT $COUNT"; __END__ Hello there boss! How are you doing today. I really hope you don't slip on that banana peel. I count 22 words.

____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.