lobs has asked for the wisdom of the Perl Monks concerning the following question:
This is my code snippet$VAR1 = { 'like' => { 'VBP' => '0.0882352941176471', 'IN' => '0.823529411764706', 'VB' => '0.0882352941176471' }, 'kind' => { 'JJ' => '0.2', 'NN' => '0.8' }, 'distribution' => { 'NN' => '1' }, 'successful' => { 'JJ' => '1' }, 'capped' => { 'JJ' => '0.666666666666667', 'VBN' => '0.333333333333333' }, ...
I've tried other examples on this site and it have yet to work. Thanks.for $key( keys %bigrams) { for $secKey ( sort { $bigrams{$key}{$a} <=> $bigrams{$key}{$b} + } keys %{ $bigrams{$key} } ) { $bigrams{$key}{$secKey} = ($bigrams{$key}{$secKey}) / ($fr +eqs{$key}); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sort Hash of hashes
by davido (Cardinal) on Mar 22, 2016 at 21:32 UTC | |
by lobs (Acolyte) on Mar 22, 2016 at 21:58 UTC | |
|
Re: Sort Hash of hashes
by tangent (Parson) on Mar 22, 2016 at 23:52 UTC | |
|
Re: Sort Hash of hashes
by Anonymous Monk on Mar 22, 2016 at 21:42 UTC | |
by lobs (Acolyte) on Mar 22, 2016 at 22:02 UTC | |
by Marshall (Canon) on Mar 22, 2016 at 23:40 UTC |