in reply to Possible Stupid Perl Trick - Importing method into object class?

Another, much cleaner method would be to modify the import() function. So, essentially, what would happen is that your Data::Type class would do an import from MyCode::ProcessC. MyCode::ProcessC would inherit from Exporter, but would overload the import() function. That import function would redefine the symbols being imported as being part of the Data::Type package. Presto, Changeo, Automagico!. :-)

(As usual whenever I'm feeling lazy, the rest of the solution is left as an exercise for the reader.)

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

  • Comment on Re: Possible Stupid Perl Trick - Importing method into object class?