Hi everyone.
My input data are like the following:

$VAR1 = { 'dove-n' => { 'mero' => { 'rump-n' => '0.0986331918077933', 'plume-n' => '0.164895598193776', 'beak-n' => '0.148781820621755', 'head-n' => '0.541972342596793', }, 'random-v' => { 'pile-v' => '0.006058551416765 +5', 'kiss-v' => '0.005277682171536 +47', }, 'cockroach-n' => { 'mero' => { 'exoskeleton-n' => '0.0665736 +517016939', 'leg-n' => '0.440277128001941 +', }, 'random-v' => { 'suggest-v' => '0.0148588 +863336517', 'guarantee-v' => '0.00591 +007188858908', 'land-v' => '0.0149882471 +117093', },

For each keys, I need the entries to be sorted by their score, so for example I'll have something like:

dove-n mero head-n 0.541972342596793 dove-n mero beak-n 0.148781820621755 dove-n mero plume-n 0.164895598193776 dove-n mero rump-n 0.0986331918077933 dove-n random-v pile-v 0.0060585514167655 dove-n random-v kiss-v 0.00527768217153647 cockroach-n mero leg-n 0.440277128001941 cockroach-n random-v suggest-v 0.0665736517016939 cockroach-n mero exoskeleton-n 0.0148588863336517 cockroach-n random-v land-v 0.0149882471117093 cockroach-n random-v guarantee-v 0.00591007188858908

I've tried reading this: http://perldoc.perl.org/perlfaq4.html#How-do-I-sort-an-array-by-%28anything%29? but I really don't get how I can achieve what I need. Any suggestions?
Thanks,
Giulia


In reply to Sorting Hashes of hashes by remluvr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.