http://qs321.pair.com?node_id=19315

PsychoSpunk has asked for the wisdom of the Perl Monks concerning the following question: (object-oriented programming)

I'm wanting to provide a bit of determinism to the constructor method, and was wondering if I can simply make
sub new { my $value1, $value2 = @_; ... }

and

sub new { my $only_value = shift; ... (not the same as above ...) }
Am I looking for too much here? Or is there just no way to really effectively pull this one off other than putting it in one constructor that does the logic and passes off to other subs based on the values it gets? Thanx. Mike

Originally posted as a Categorized Question.