I just started using Class::MethodMaker this week. I'm writing a new distro (to deal with the OpenURL standard) and my lead asked me to write it using C::MM, which I thought was cool. It's what's installed on all the servers where I'm working* and I've heard good things about it.

So, I set up a few classes and almost immediately run into a bug with C::MM 2.05. I patched my local version and continued on my way. No biggie - this happens all the time. Patching it was a little weird cause I've never worked with AutoSplit before, but that's ok - it never hurts to learn something new.

Now, here's where the politics of opensource and the politics of my employer start intersecting. I can't ask FLUFFY to speed up fixing my bug and getting it into a new release2. I also can't keep holding off the upgrade from C::MM 1.12 to 2.x. And, they won't install my patched version because it's not the official version.

To top it all off, I have an enhancement I really want added to make my coding life a lot easier. I mean, if that's not the whole point, why use C::MM in the first place? But, I wanted to run it past y'all first before bugging FLUFFY about it. I want to have an attribute that looks something like:

use Class::MethodMaker [ new => 'new', scalar => [ { -type => 'Some::Class', -default_ctor => 'new' }, 'some_class', ], ];

Now, I understand that whenever you do a get on some_class(), you'll get back a new Some::Class object, and that's the desired behavior. But, I want to be able to do

$object->some_class_reset(); ok( !$object->some_class_isset(), "I just reset the damn thing, so it shouldn't be set yet!", );

Except, C::MM has an optimization that says if a default/default_ctor is defined, the attribute is always considered to be set, even if it has just been reset. Is there a way around this without patching C::MM::scalar? And, if there isn't, does anyone have any advice for me on patching it? FLUFFY's code is downright scary. Very cool, but scary all the same.

And then, does anyone have any advice for me re: the office politics vs. the opensource politics? Does anyone have a good mailing list/forum for C::MM that has had more than 30 messages in the last 2 years?

  1. It's a real PITA to get stuff installed at this place. I can't even get Text::xSV installed as a bugfix over Text::CSV. There's over a hundred common servers and a Sun workstation at almost every employee's desk. (I'm a contractor.) Perl isn't the major management focus, so the only guy with both the rights and the know-how to install Perl modules is the network admin. In other words, I would have to figure out how to get him to spend part of his 60-hour workweek (in which he does 100 hours of work) to install my module. Yeah, riiiiight.
  2. I got pissed off when someone did that with me for PDF::Template, especially cause they were asking for 80 hours of unpaid work to be done in a month.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.


In reply to Class::MethodMaker, workplace politics, and patches by dragonchild

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.