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