Fuzzy Frog,
I am not familiar that module, but since I wrote Tie::Hash::Sorted, you might want to try:
#!/usr/bin/perl use strict; use warnings; use Tie::Hash::Sorted; my $sort = sub { my $h = shift; [ sort { $h->{$a}[0] cmp $h->{$b}[0] || $h->{$a}[1] cmp $h->{$b}[1] || $h->{$a}[2] cmp $h->{$b}[2] } keys %$h ]; }; tie my %s_hash, 'Tie::Hash::Sorted', 'Sort_Routine' => $sort, 'Optimiz +ation' => 'values'; %s_hash = ( 1 => [ qw(Frog Fuzzy A other_stuff) ], 2 => [ 'Frog', 'Fuzzy', '', 'other_stuff' ], 3 => [ qw(Toad Zola Q other_stuff) ], 4 => [ qw(Frogger Anthony J other_stuff) ], 5 => [ qw(Frog-Toad Berl G other_stuff) ], ); print "$_\n" for keys %s_hash;
It will automatically keep the hash sorted even if you add/delete keys or modify the key's value to a new anonymous hash. You will have to read TFM carefully if those array refs are not anonymous as some other code may modify their values behind the scense (which requires modifying the optimization type). If you want more info let me know - I am late for a meeting.

Cheers - L~R


In reply to Re: Data::Sorting by Limbic~Region
in thread Data::Sorting by Fuzzy Frog

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.