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


in reply to How do I make deterministic constructors?

Howdy!

Consider:

sub new { if (@_ == 2) { new_1(@_); } elsif (@_ == 1) { new_2(@_); } else { warn "bad parameter..."; } }
where subs new_1 and new_2 are your alternatives. You can do more detailed checking of the characteristics of the contents of @_ as needed. Of course, there is Class:Multimethods as mentioned earlier to automate this.

yours,
Michael