Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Re: Re: OO Perl: calling a constructor within a class

by runrig (Abbot)
on Sep 28, 2001 at 01:02 UTC ( [id://115260]=note: print w/replies, xml ) Need Help??


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).
  • Comment on Re: Re: Re: OO Perl: calling a constructor within a class

Replies are listed 'Best First'.
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://115260]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-18 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found