sorting the keys so that the code generation is consistent across different
perls.