in reply to Can't bless
sub new { my ($class) = @_; return bless {}, $class }
That's because when you inherit from the class, the constructor will work for the new class, as well, without a need to write a new one specifying the subclass.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't bless
by BernieC (Pilgrim) on Mar 21, 2021 at 17:45 UTC | |
by choroba (Cardinal) on Mar 21, 2021 at 19:07 UTC | |
by Anonymous Monk on Mar 22, 2021 at 05:08 UTC | |
by ikegami (Patriarch) on Mar 22, 2021 at 08:19 UTC |