Then I would change your hash to:
$counting{word}{$word}{str1}=$counter; $counting{word}{$word}{str2}=$counter;
And then (see here for min function examples):
foreach my $word (keys %{$counting{word}}) { print "$word\t", min ($counting{word}{$word}{str1}, $counting{word}{$word}{str2}) }
In reply to Re^3: Comparison between keys in hash
by i5513
in thread Comparison between keys in hash
by sarvan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |