nope that only counts the word once per line..
if the word was in the line twice it would only count it once.

> -----Original Message-----
> From: Mat Harris [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 17, 2002 12:06 PM
> To: ANIDIL RAJENDRAN
> Cc: [EMAIL PROTECTED]
> Subject: Re: Counting the same word
> 
> 
> i think this will work, but don't complain if it doesn't 'cos 
> im tired. ok?
> 
> #!/usr/bin/perl
> 
> $count = 0;
> while (<FILE>)
>       {
>       if (m/california/)
>               {
>               $count++;
>               }
>       }
> print "california: $count\n";
> 
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to