See Restricted hashes in Hash::Util.
In reply to Re: strict "vars" mode for hash key literals? by hippo in thread strict "vars" mode for hash key literals? by perlancar