I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2006-01-20 23:05:26-08 by cowanbill
Suggestion for new accessor style
Class::Meta offers a useful accessor style that you may want to consider. From Class::Meta doc:
The boolean data type is the only one that uses a slightly different approach to the creation of affordance accessors: It creates three of them. Assuming you're creating a boolean attribute named "alive", it will create these accessors:
sub is_alive { shift->{alive} } sub set_alive_on { shift->{alive} = 1 } sub set_alive_off { shift->{alive} = 0 }

Suggested accessor style name is 'bool' or 'boolean'.
A good coding practice is to prefix the boolean attribute/field with 'is_', i.e. 'is_alive'. Example: 'is_finished' for the object attribute. Using the above accessor style would require naming the boolean attributes without the 'is_'; this seems to be a reasonable approach. Other thoughts on how to fit coding practive with this useful accessor style?

Thanks for your hard work, Bill
Direct Responses: 1672 | Write a response