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