#!/usr/bin/perl -w use strict; use Storable; my $search_word = uc shift or die "search word required\n"; my @words = (); my @dict; my $rdict; my $count = 0; if (not -e 'words.sto') { open WORDS, '/usr/share/dict/words' or die "can't open words file\n"; while () { chomp; push @dict, uc $_; } close WORDS; $rdict= \@dict; store $rdict, 'words.sto'; } else { $rdict= retrieve('words.sto'); } for (@$rdict) { printf "%3d %s\n", ++$count, $_ if $search_word =~ /$_/; }