Fetch a word definition from dictionary.com. Cheat by using their WAP interface. (Note: I imagine this has probably been done many times before)
#!/usr/bin/perl use strict; use warnings; use LWP::Simple qw(get); use HTML::Parser; my($word) = shift() || die("Usage: $0 <word>\n"); my($html) = get('http://www.dictionary.com/cgi-bin/dict.pl?config=hdml +&term=' . $word) || die("get() '$word' failed: $@"); HTML::Parser->new(text_h => [ sub { foreach (shift()) { print() if (/\ +w/); } }, 'dtext' ])->parse($html); print("\n"); exit();

Replies are listed 'Best First'.
(crazyinsomniac: ;D)Re: Quick dictionary.com definition
by crazyinsomniac (Prior) on May 28, 2002 at 09:25 UTC