title: How can I create a nested hash as a constant in Perl?
body: <p>I want to do, in Perl, the equivalent of the following Ruby code:</p>
  
  <pre><code>class Foo
    MY_CONST = {
      'foo' =&gt; 'bar',
      'baz' =&gt; {
        'innerbar' =&gt; 'bleh'
      },
    }
  
    def some_method
      a = MY_CONST[ 'foo' ]
    end
  
  end
  
  # In some other file which uses Foo...
  
  b = Foo::MY_CONST[ 'baz' ][ 'innerbar' ]
  </code></pre>
  
  <p>That is, I just want to declare a constant, nested hash structure for use both in the class and outside.  How to?</p>