in reply to Re: Re: OO Perl: calling a constructor within a class in thread OO Perl: calling a constructor within a class
I agree that for this particular example a workaround is trivial and this module is probably not the best way to go, but I think the general idea of the module is great and can be used in non-trivial ways. And it might be one way to go for the original poster's problem, though (from my limited understanding of Class::Mulitmethods), he would have to do something more different than just passing in a simple scalar string with two different values, he would have to instead have different argument types or different numbers of arguments (Class::Multimethods doesn't seem to be able to dispatch based on the value of scalar args, just their type).
An OO Challenge (Was Re4: OO Perl: calling a constructor within a class)
by dragonchild (Archbishop) on Sep 28, 2001 at 01:13 UTC
|
I would very much like to see a case in Perl where the exact same function name has to be used for two completely different functions within the same object. In fact, I put this up as a friendly challenge, runrig. Actually, it's open to anyone who cares to try. :-)
------ 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. | [reply] |
|