That would be a lot cleaner, but there are no such methods and any code that I produce can't rely on them, due to backwards-compatibility requirements. Sigh... Even if those methods werre available, my constructor may never get called as the the methods can be used as functions.
I'm seeing some issues with dragonchild's solution, but it certainly seems like the only workable prospect (and it's pretty cool, too).
Cheers,
Ovid
Update: Hmm... or I could create the mutators myself and add them to Foo's symbol table.
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|