in reply to Calling subclass’ method from superclass
Your issue seems to be that you're calling $Own::Dir->new instead of Own::Dir->new. $Own::Dir is the $Dir variable within the Own package. And it's undefined. Leave the dollar sign out.
Also, for what it's worth, Own might be better written as a role instead of a class. There are various implementations of roles available, but I recommend starting with Role::Tiny.
And another thing, Path::Tiny might be easier to subclass than Path::Class because it uses the same class for both files and directories. Apart from that, they have pretty similar APIs, so switching from one to the other is usually pretty easy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calling subclass� method from superclass
by Fendo (Novice) on Feb 05, 2019 at 20:06 UTC |