in reply to Sort not acting as expected on Hash Ref

Try this:

foreach my $key (sort {$b <=> $a} keys %$sort_line_contents) { print join("\n", values %{$sort_line_contents->{$key}}), "\n"; }
First the keys are sorted, and for each of those, all values are printed.

Hope this helps, -gjb-