package Speller; use strict; use Filter::Simple; use String::Similarity; my %known; @known{qw(abs accept alarm and ARGV atan2 BEGIN bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir cmp connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif END ENV eof eq eval exists exit exp EXPORT EXPORT_OK fcntl fileno flock for foreach fork format formline ge getc getlogin getpeername getpgrp getppid getpriority getsockname getsockopt glob gmtime goto grep gt hex HOME if import INC index int ioctl ISA join keys kill last lc lcfirst le length link listen local localtime lock log lstat lt m map mkdir my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push quotemeta rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir s scalar seek seekdir select send setpgrp setpriority setsockopt shift shutdown SIG sin sleep socket socketpair sort splice split sprintf sqrt srand stat strict study sub substr symlink syscall sysopen sysread sysseek syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unpack unshift untie until use utime values vec wait waitpid wantarray warn while write x xor y)} = undef; FILTER_ONLY code => \&filter; sub filter { s/\b(? $limit) { $best_choice = $known; $limit = $similarity; } } return $best_choice; } 1;