Perl は難しすぎる。
Ruby では、

hash = { a: 1, b: 2 }

hash.each_key { |key| p key }

出力。:a などはシンボル
:a
:b