in reply to Re: How do I make deterministic constructors?
in thread How do I make deterministic constructors?
I'd suggest using the goto &subroutine syntax for this case:
The benefit of this is that in every respect (e.g. for caller or croak) it looks like new_1 (or new_2) have been called directly - and not through new.sub new { if (@_ == 2) { goto &new_1; } elsif (@_ == 1) { goto &new_2; } else { warn "bad parameter..."; } }
-- Hofmator
|
|---|