I may have missed something obvious, and excuse me for not reading every line of code, but it seems to me that the output is correct. In your 'list_' subroutines you are printing the same hash each time. For example, in list_holidays you are sorting %p_list_holidays but printing %p_list_weekdays. That could be what you intend, if so then I have misunderstood the problem, and apologies.