in reply to Abstract Packages
When I need abstract methods, I usually do:
Same general principle, but I think it's a little cleaner.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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Abstract Packages
by Velaki (Chaplain) on Aug 05, 2004 at 11:47 UTC |