in reply to word association problem
open(LIST, "wordlist.txt"); open(MSTR, "master.txt"); my @wordlist = map { chomp; $_ } <LIST>; my @master = map { chomp; $_ } <MSTR>; foreach my $word ( @master ) { print "$word:",join(",",grep(/$word/,@wordlist)),$/; }
update: oh yeah -- gotta use "chomp", not "chop".
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: word association problem
by Chmrr (Vicar) on Aug 06, 2002 at 03:58 UTC |