The idea to look there didn't occur to me, so I looked in that source. Sadly I did not find any reference to using a method modifier on 'install_accessors' (which is really a method in Moose::Meta::Atribute).

When I blindly replace my BUILD definition with your method modifier idea, I get:

The method 'install_accessors' was not found in the inheritance hierar +chy for Me at /usr/local/lib/perl5/site_perl/5.10.1/mach/Class/MOP/Cl +ass.pm line 659 Class::MOP::Class::__ANON__('Moose::Meta::Class=HASH(0x8025684c8)' +, 'install_accessors') called at /usr/local/lib/perl5/site_perl/5.10. +1/mach/Class/MOP/Class.pm line 694 Class::MOP::Class::add_after_method_modifier('Moose::Meta::Class=H +ASH(0x8025684c8)', 'install_accessors', 'CODE(0x802568d98)') called a +t /usr/local/lib/perl5/site_perl/5.10.1/mach/Moose/Util.pm line 229 Moose::Util::add_method_modifier('Moose::Meta::Class=HASH(0x802568 +4c8)', 'after', 'ARRAY(0x802443288)') called at /usr/local/lib/perl5/ +site_perl/5.10.1/mach/Moose.pm line 77 Moose::after(undef, 'install_accessors') called at /usr/local/lib/ +perl5/site_perl/5.10.1/mach/Moose/Exporter.pm line 293 Moose::after('install_accessors', 'CODE(0x802568d98)') called at . +/testm line 41

This makes some sense because my class uses Moose, doesnt use an 'extends' keyword, and isn't necessarily a subclass of Moose::Meta::Attribute. Obviously I'm missing something here, but what?


In reply to Re^2: Moose: Adding methods to a class via attribute traits by Nasrudin
in thread Moose: Adding methods to a class via attribute traits by Nasrudin

Title:
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, details, 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, summary, 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.