#!/usr/bin/perl
#use strict;

my $voc = 'vocfuzzy -b';
use Term::ReadLine;
$term = new Term::ReadLine 'Simple Dict';
$prompt = "Enter your word: ";
$OUT = $term->OUT || STDOUT;
while ( defined ($_ = $term->readline($prompt)) ) {
  if ( $_ ) {
   open(T, "$voc  $_|");  
   @res = <T>;
   close(T);
   print $OUT @res, "\n";
  }
  $term->addhistory($_) if /\S/;
}
