my $input = $ARGV[0]; $input = str2val($input); # dictionary already pre-processed # create hash of possible subset values # ... while (<$dict_fh>) { chomp; my ($word, $val) = split /\t/; print "$word\n" if $is_subset{$input - $val}; }