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
In reply to Re: Answer: How do I make deterministic constructors?
by Hofmator
in thread How do I make deterministic constructors?
by PsychoSpunk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |