in reply to Class::MethodMaker object_list help needed

Since I hate questions without answers and nodes without conclusions--here are my findings.

I was being an idiot. However, I think the manner in which I discovered this Simple Truth is worthwhile reading. First, the answer.

In the example code above, the correct syntax for calling the forwarded name method for the MyPackage::List object is as follows.

print $list->name; # NOT: print $list->items->name

Of course, this seems obvious with hindsight. It's a method of the $list object! I think I was trapped in a VB mindset and couldn't see the obvious Perlish use... or something.

Anyway, on to the important bit.

How I figured this out--aka How to 'Do The Work'

  1. I read the POD.
  2. I read the POD again.
  3. I looked at the module source*
  4. I used Super Search to look for "MethodMaker".
  5. I used Google to look for "MethodMaker".
  6. I spent a long time finding every pod2html mirror in existence.
  7. I got smart and Googled the comp.lang.perl groups.
That's when I found a nice thread about exploring the symbol table--and knew that was where I could find the name (hence, usage) of the Class::MethodMaker method. Dominus posted the code I used.

Moreover, I found a wealth of other information. For instance, "-sugar" probably shouldn't be used... and a long list of reasons that I should use Class::MakeMethods instead.

Now, if I could only get Class::MakeMethods 1.006 to build under Win32... **sigh** ...back to work!

--
* The point in time that I scratched my head and called for backup.

May the Source be with you.

Replies are listed 'Best First'.
Re: How to 'Do The Work' (was Re: Class::MethodMaker object_list help needed)
by simonm (Vicar) on Sep 15, 2003 at 18:36 UTC
    For what it's worth, the problem with Class::MakeMethods 1.006 on Windows was just a "make test" failure (see node 276489) -- the module itself worked correctly -- and that problem should be fixed in the new 1.008 release.