sub some_abstract_method { __abstract($_[0], caller); # ... } sub __abstract { my ($thing, $pkg, $file, $line) = @_; return if $thing ne __PACKAGE__; my $func = (caller 1)[3]; die "$func is abstract; in $file line $line\n"; }