Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Moose in a module created with h2xs

by tobyink (Canon)
on Feb 23, 2019 at 10:22 UTC ( [id://1230457]=note: print w/replies, xml ) Need Help??


in reply to Moose in a module created with h2xs

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.

Replies are listed 'Best First'.
Re^2: Moose in a module created with h2xs
by Laurent_R (Canon) on Feb 23, 2019 at 10:41 UTC
    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.
    That's definitely true in French (using vous instead of tu to convey extra respect), but that's somewhat inaccurate in German, where the "respectful" form of du is, as far as I can tell, Sie, which is more like the German for "they" (and also for "she" *). But I'll leave it to German native-speaking monks to confirm and elaborate further if needed.

    Update: * But the verb is conjugated at the 3rd person plural, so it appears it's really "they," not "she."

      No, you're right. It's a long time since I studied German. "Sie" means "they", but can be used as the polite form for singular or plural you.

        That stems from a time, when the normal "Ihr" (plural 'you') was considered somehow "reserved" for nobility, so for "normal" people, one resorted to "Er" ('he') / "Sie" ('she') as a polite form for singular 'you', with the corresponding plural "Sie" ('they') even more polite. Nowadays we are using plural "Sie" nearly exclusively.

        The French were able to stay with 'tu'/'vous' because they abolished their nobility instead ; -)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1230457]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-19 05:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found