in reply to Re^3: Transparently inheriting functions from a parent package
in thread Transparently inheriting functions from a parent package
package Basehandler; BEGIN { use Exporter; our @ISA = qw (Exporter); our @EXPORT = qw (handler .... setup_environment ); } use Module::I::Always::Use::1; ... use Module::I::Always::Use::35; sub handler { ... same 50 lines of code that do validation and then a jump table +to my real work functions ... } sub setup_environment { .... } -- MyHandler/ForThisEndpoint.pm -- package MyHandler::ForThisEndpoint; use Basehandler; sub work_function_1 {} ... sub work_function_100 {} -- MyHandler/ForAnotherEndpoint.pm -- package MyHandler::ForAnotherEndpoint; use Basehandler; sub work_function_1 {} ... sub work_function_100 {}
|
|---|