in reply to sort while push in hash

based on your vague input:
@{ $hash{a} } = sort (@{ $hash{a} }, $ele);
(which might be inefficient if you do this often; then i'd rather sort at the end)