#!/usr/bin/perl use strict; use warnings; my $sw = lc shift or die "search word required\n"; 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 index($sw,lc $_) > -1; } close WORDS;