|Just another Perl shrine|
Re^3: a loop for creating subroutines?by LanX (Abbot)
|on Aug 28, 2012 at 08:47 UTC||Need Help??|
I've shown you two ways and the second works for objects too. (in perl package == class)
Don't know too much about moose.
But if you ask for "the cleanest" approach, better avoid metaprogramming!
Just define two getters and use a fat comma to get rid of the quoting.
I like metaprogramming, but here it's over the top.
And this certainly works with moose too!