in reply to Sorting a Hash of Hashes

You are over-complicating things.
To print the keys of your hash, sorted numerically - all you need to do is:
for (sort {$a <=> $b} keys %foo) { print "$_\n"; }

Update: - to more directly answer your question, you need to change this line:

for my $k ( sort {%{ $ref_HoH{$a} } <=> %{ $ref_HoH{$b} } }keys %$r +ef_HoH ) {
..to read like this:
for my $k (sort {$a <=> $b } keys %$ref_HoH) {

Cheers,
Darren :)