Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Moose in a module created with h2xsby tobyink (Canon) |
on Feb 23, 2019 at 10:22 UTC ( [id://1230457]=note: print w/replies, xml ) | Need Help?? |
The plural of "thee" is "you". French and German and a lot of other languages have different words for you singular and you plural. French and German in particular have an interesting feature that you can use the plural form of you when talking to a single person to convey extra respect. In English, we did the same thing with thou/thee as the singular and you as the plural/respectful version. But because English folk are so inescapably polite and apologetic, thou/thee disappeared and is now considered archaic/obsolete. (As an aside, some languages — such as Indonesian — also have different words for the inclusive and exclusive forms of "we". For example, if I say "we are going to the cinema", do I mean "you, me, and some other people are going to the cinema" or do I mean "me and some other people are going to the cinema, but not you"?) Anyway, in answer to your main question, do use Moose in each class you define and use Moose::Role in each role you define. For packages which are neither classes nor roles (e.g. packages which are just a collection of utility functions, constants, etc), use neither. And all the exporter stuff, you should only use in packages that you wish to use as exporters. Unless you're doing something really weird, those are three different exclusive kinds of modules — exporters, classes, and roles. You should probably never write a module that acts as both a role and an exporter, for example. (You know those Venn diagrammes? Don't write modules which live in the overlapping bits.) Although you don't say so explicitly, you seem to be implying that you'll define multiple packages in the same module file. While there's certainly no prohibition in doing this, it can introduce a few gotchas when it comes to trying to use those packages. It's usually best to stick to one-package-per-file unless you have a very good reason not to.
In Section
Seekers of Perl Wisdom
|
|