in reply to (tye)Re: Possible Stupid Perl Trick - Importing method into object class?
in thread Possible Stupid Perl Trick - Importing method into object class?
I've been trying to think of a way to place this in a parent class that the other process classes can inherit from, but there would seem to be a problem with the order of new, import, and the like that that I can't seem to find a way to get this to work.
Again, VERY hypothetical code:
Alternatively, I'm wondering if modifying dws's idea above might be worth exploring. That is, add a register function to the DataType class, which stores what names are associated with with package and function, then have, in the process module's begin block, call that global-level function to register code. Then use AUTOLOAD in the DataType to handle those type of classes.package My::ProcessC; BEGIN { my @processfuncs = qw ( processC processC_alt ); } use My::ProcessParent qw(register);
-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(tye)Re2: Possible Stupid Perl Trick - Importing method into object class?
by tye (Sage) on Dec 08, 2001 at 03:53 UTC | |
by Aristotle (Chancellor) on Dec 10, 2001 at 05:30 UTC | |
|
Re: Re: (tye)Re: Possible Stupid Perl Trick - Importing method into object class?
by dragonchild (Archbishop) on Dec 08, 2001 at 01:02 UTC | |
by tye (Sage) on Dec 08, 2001 at 04:22 UTC |