Well, I know right off the bat you can't 'see' how it does what it does. 
Even though you know it is printing elements of a hash, it isn't obvious 
how they are being printed. Well, that isn't exactly true, since it loops 
through in order you know how, but how did it get into that order? That is 
the guts of it all. From what I know of the contest, and my past entries, 
I think it has a chance.

For anyone who hasn't figured out the 'how', it basically does a SQL 
"order by x, y, z" on a Hash-o-hashes by building dynamic cmp statements, 
evaling  them, and rearranging the original hash by  the order, then moving 
to the next elemens (if needed) and cmp'ing the needed hashes, then rearranging 
them, etc...

So:

%HoH = {0 => {T => "Journal",
		  P => "Perl", # Or whatever $^X is with path removed
		  J => "Read"},
        1 => {T => "Today",
		  P => "Perl",
    		  J => "Hack"}
        };

Is then ordered by J, P, T

So, ordering by J produces the final result. 
This example only sorts once, on the J, and since there are no remaining hashes, 
it turns inner hash 1, into 0, and inner hash 0, into 1, which allows for the 
printing  in the order it is already sorted by. 

So you get:
Hack Perl Today  
Read Perl Journal  

It may not work in all cases, it all hasn't been bullet-proof tested, 
but works for the example for the contest :) Actually, it is taken from a 
sub written to do the same thing, which does work in all cases.


This is a non-obfuscated version (done in haste, and not-ready-for-prime-time) done 
to show the concept, also adding another inner hash in the mix:

#__START__

%HoH = (0 => {"T" => "Today",
		  "P" => "Perl",
    		  "J" => "Hack"},
	1 => {"T" => "Journal",
		  "P" => "Perl", # Or whatever $^X is with path removed
		  "J" => "Read"},

	  2 => {"T" => "Toad",
		  "P" => "Perl",
		  "J" => "Hack"}
        );

print "\n";
my @args = ('J', 'P', 'T');
my $HoH_ref = sortIt(\%HoH,@args);
print "Original HoH:\n";
my %HoHs = %$HoH_ref;
foreach $e (keys %HoH) { 
   print "$e: $HoH{$e}->{J} $HoH{$e}->{P} $HoH{$e}->{T}";
   print "\n";
}
print "\n";
print "New HoH:\n";
foreach $f (keys %HoHs) {
   print "$f: $HoHs{$f}->{J} $HoHs{$f}->{P} $HoHs{$f}->{T}";
   print "\n";
}

sub sortIt {
	my $hh = shift;   
	my %hh=%$hh;
	my @stuff = @_;
		my %sHoH;
		my $i = 0;
		foreach $family (sort {
			my $pri_string = "$hh{$a}{$stuff[0]} cmp $hh{$b}{$stuff[0]} ";
		        my %crud = $hh{$a};
                        for (my $cmp_num=1; $cmp_num < @stuff; $cmp_num++) { 
                 	       $pri_string .= "or $hh{$a}{$stuff[$cmp_num]} cmp $hh{$b}{$stuff[$cmp_num]} ";
                        }
                        $pri_string .= ";";
                        eval $pri_string;
                } keys %hh ) {
			for $role (keys %{$hh{$family}}) {
			        $sHoH{$i}{$role} = $hh{$family}{$role};
         		}
         	$i++;
      		}
	        return(\%sHoH);
	 
}

#__END__


Which returns ->

Original HoH:
0: Hack Perl Today
1: Read Perl Journal
2: Hack Perl Toad

New HoH:
0: Hack Perl Toad
1: Hack Perl Today
2: Read Perl Journal

So, you can see it was ordered by J which would put the two hashes with 'Hack' before 
'Read', then by P, which would do nothing since the remaining two both have 'Perl', 
then by T, which puts 'Toad' before 'Today'. 

