in reply to Re^2: Comparison between keys in hash
in thread Comparison between keys in hash
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}) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Comparison between keys in hash
by sarvan (Sexton) on Jul 07, 2011 at 06:14 UTC | |
by i5513 (Pilgrim) on Jul 07, 2011 at 08:11 UTC | |
by sarvan (Sexton) on Jul 07, 2011 at 10:33 UTC | |
by Anonymous Monk on Jul 08, 2011 at 02:17 UTC |