Then you need to either use (ref $self)->new(...) or have your constructor accept both, a reference or a string (that is, doing the my $class = ref $self || $self;). Having such a dual-use constructor makes or at least made some people scream in agony, but I never really understood why.
In reply to Re^3: calling new inside the same module?
by Corion
in thread calling new inside the same module?
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |