|There's more than one way to do things|
declaration order of attributes in Mooseby morgon (Deacon)
|on Apr 13, 2009 at 20:37 UTC||Need Help??|
morgon has asked for the
wisdom of the Perl Monks concerning the following question:
Hi, I wonder if there is an "official" way to retrieve the order in which attributes have been declared in a Moose-based class, e.g. when I have a class defined as
I want to have a way to retrive (via the meta-class) the information that abba has been declared before zappa.
In fact I can get to what I want by doing this:
Then @atts contains the list "abba", "zappa".
But of course this looks a bit hacky...
And please don't ask me what I need it for - at the moment I am just learing what you can and cannot do with Moose.