in reply to Getting keys of a hash element

you can also use smarts shortcuts
print sort keys %hash;
or
print join "\n" , sort keys %hash;
if you need some separators.