Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I'm enjoying the benefits of using Moose, and I wanted to enquire into some of the finer aspects of development with Moose.

Most of it is intuitive and very helpful. My compliments to the developers.

I have a couple of questions nonetheless:

I note that there exists both a trigger and a builder option. The trigger option, by use and testing has become clear. The builder option is somewhat similar, although it is passed as a scalar method name and not a coderef. Why a builder and a trigger option, and what are the finer points of the builder option? I ask as much to divine the intent of and the future direction of the design and development of Moose as for practical reasons.

as in:

has 'x' => (is => 'rw', isa => 'HashRef', builder => 'build_x'); has 'y' => (is => 'rw', isa => 'HashRef', trigger => \&y_trigger);

The trigger is as the docs say, "a CODE reference which will be called after the value of the attribute is set. The CODE ref will be passed the instance itself, the updated value and the attribute meta-object."

There is not too much information on builder in the Moose perldoc. Anyone care to elaborate?

Now for a more fun question. Metaclasses have been described as a solution in search of a problem. Anyone care to share any clever problems and solutions using Metaclasses in Moose?

In reply to Moose - nalia by doc_faustroll

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [hippo]: (asking because I'm sure you said before about learning English) Did you know there are 2 different words for smaller quantities in English? They are "less" and "fewer". Fewer applies to a number of discrete things like days.
    Eily notes also
    [hippo]: So if you don't drink as much milk and not as often you are said to drink less milk on fewer days. Confusing, eh?
    [Eily]: same as many/much, few/little
    [Discipulus]: so my 'less' usage sounded not so correct? 'fewer' was more appropriate? i take a note too

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (5)
    As of 2018-01-23 09:12 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (242 votes). Check out past polls.