use strict; # finds the words in $otherfile that are not in $wordfile; my $wordfile = shift; my $otherfile = shift; sub dict_line{ our %dict; my $line = shift; print $line; my @words = split $line; #print"@words"; foreach my $word (@words){ $dict{lc $word}++; #print "$word\n"; } } sub find_missing{ our %dict; my $line = shift; my @words = split $line; foreach my $word (@words){ print "$word\n"; my $word = lc shift; print "* $word\n" if !defined $dict{$word}; } } sub read_file{ my $file=shift; my $subref = shift || \&read_line; open (FILE, $file) || die "couldn't open $file $!"; while (my $line = ) { $subref->($line); } } read_file $wordfile, \&dict_line; read_file $otherfile, \&find_missing;