in reply to Re^2: Exporting constants from a Moo role
in thread Exporting constants from a Moo role
Thanks Toby! init_arg => undef is a new one on me. Why do you need to declare a default value (or what is the point) when you use that parameter to the attribute?
I quite often use simple subs for constants if only because the syntax to declare them is simpler and shorter. I guess the author of this code (which is used to access the elements of a work queue job) prioritized simpler and shorter syntax at the calling end, preferring $self->job->[INDEX_FOO] to $self->job->[ $self->INDEX_FOO ] ...
I think I like the solution you showed in your other reply. Thanks again!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Exporting constants from a Moo role
by tobyink (Canon) on Aug 03, 2018 at 11:49 UTC |