in reply to Re^2: calling new inside the same module?
in thread calling new inside the same module?
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.
|
|---|