[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Porting a Perl Program



> I have written a very small program in PERL to read in HTML files from a
> remote source and then count the 5 most frequent words.

You don't say how many unique words are coming in, but let's assume that
there are only a few hundred thousand.  If so, you could index a hash
with the incoming words, incrementing the corresponding position as each
word comes in.  At the end, walk through the hash and get the top N counts.

-r

Rich Morin, Canta Forda Computer Laboratory | Prime Time Freeware - quality
  UNIX consulting, training, and writing    | freeware at affordable prices
  P.O. Box 1488, Pacifica, CA, 94044, USA   | www.ptf.com      info@ptf.com
  rdm@cfcl.com            +1 650-873-7841   | +1 408-433-9662   -0727 (Fax)



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch