in reply to Class::MethodMaker object_list help needed
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.
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 |