note
brian_d_foy
<p>
Oh, you're not looking for singleton objects. You're looking for objects of the same class to have the same method names but do different things based on the object. Singletons aren't about the method names but how many objects there actually are.
</p>
<p>
You have a bit of an [id://542341] here since we don't know what you are trying to solve. What are you trying to accomplish (rather than how you are trying to do it)?
</p>
<p>
If you want the objects to start off as the same class and specialize later, look at [cpan://Class::Prototyped]. Each object can start the same, but then gain or replace methods (called "slots" in prototype programming). Randal's [cpan://CGI::Prototype] stufff is based on this and once you get used to the idea it's very nice to work with given an appropriate problem.
</p>
<p>
Good luck, :)
</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-366986">
-- <br />
brian d foy <brian@stonehenge.com><br />
Subscribe to <a href="http://www.theperlreview.com">The Perl Review</a>
</div></div>
682038
682100