in reply to two order sort

out of curiosity: why do you use reduce instead of sum from List::Util ?

Cheers Rolf