Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Net::DICT; #Clear "file" open (FILE, ">.vocab_file"); print FILE ""; close FILE; open (LIST, "vocab_list") || die "Missing vocab list?\n"; while ($word = <LIST>) { #Lookup definition... $dict = Net::DICT->new(); $dict->open('dict.org') || die "can't connect to dict.org: $!, " . $dict->errn +o() . "\n"; @def = $dict->define('!', $word); open (FILE, ">>.vocab_file"); foreach (@def) { print FILE "$$_[3]"; } close FILE; $dict->quit; } close LIST;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: string matching/dictionary
by CukiMnstr (Deacon) on Apr 09, 2002 at 22:06 UTC |