- or download this
package AbstactFoo;
...
sub new {
die "Don't create any Abstract Foos direct, fool!";
}
- or download this
package AbstractFoo;
...
sub new {
...
...
my $foo1 = new SubclassOfAbstractFoo(); # GOOD
my $foo2 = new AbstractFoo(); # BAD
- or download this
package AbstractFoo;
...
sub new {
...
if $package eq "AbstractFoo";
bless { @_ }, $package;
}