#!/usr/bin/perl

$file = "word.txt";

open(WORDS,$file) || die "Gurgle...$!";

print "Have opened $file with search terms\n";

@words = <WORDS>;

chomp (@words);

#print @words;

foreach $w (@words){
    
    $dictionary{lc $w}=" ";
}

print "Done setting up dictionary\n";

while(true){

print "Please enter a word to search,blank to quit\n";

$wordfind = <STDIN>;

chomp($wordfind);
die if $wordfind eq "";
print "Will look for $wordfind\n";

if($dictionary{$wordfind} ) {

    print "$wordfind Found in file\n";
} else {
       print "$wordfind not found in file\n";
}

}
