in reply to Re: (ichimunki) Re x 3 : OOP,
in thread OOP, ".NET", Perl, and all that

Well that's just it. Having to know which constructor to call based on my type of inputs is somewhat unnecessary (in Perl), as the constructor itself has many ways to determine what it was given to work with. But I see your point, especially since I would gladly prefer a Class::copy->( $existing_instance ) method over simply doing $existing_instance->new(), unless the whole idea was to create a default or blank instance and not a copy of the existing instance.

But as to how those are implemented inside the class-- if you aren't factoring out any commonalities in your constructors into private methods you are duplicating code somewhere along the line. Hence, even your four different examples should be little more than wrappers around a private _new method. To me that's the important point here.

note: and either way, none of this precludes using package-scoped variables to define default attributes as a way of supporting defaults even in highly compartmentalized constructors.