Constant attributes

[email protected] (Bernardo Rechea)
Newsgroups perl.moose
Message-ID <[email protected]>
I wanted a constant attribute, i.e., one that is read-only and not settable
at construction time. I found a solution by making it a class attribute
with MooseX::ClassAttribute, setting its 'is' property to 'ro', and
providing a default value.

It seems a bit of a roundabout solution, so I'm wondering whether there is a
better way to go about constant attributes. Any suggestions?

Bernardo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.