You are missing a constructor (sub MyPackage::new), search for "sub new" in Modern Perl or "sub new"
You can squat/monkeypatch like sub SVG::Element::Foo { ... } which can work well for one-offs/scripts... and oftentimes is the only reasonable way to extend some classes
In reply to Re: Extending a class
by Anonymous Monk
in thread Extending a class
by betacentauri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |