Hi,
I want to count the number of times a particular  word occured in a file. Though the  
following script is working, is it possible to shorten it?

------

open (FILE,"C:\\proj\\order\.txt") or die "cannot open file: $!";
%seen = ();
while (<FILE>) {
 while ( /(\w['\w-]*)/g) {
  $seen{lc $1}++;
}
} 
print "california: ". $seen{"california"}."\n";

------------

Reply via email to