while (my $dict = <>) { chomp $dict; my $nodict = join q(), 'a' .. 'z'; $nodict =~ s/[$dict]//g; $_ = <>; s/\?/[$dict]/g; s/\*/[$nodict]*/;