in reply to Sorting using coderef's, and passing parameters

foreach( sort { $sort_routine->( \%href ) } keys %{$someref} ) { ... }