Hello Anonymous,
It now works, thanks to Moose::Role. I tried Moose::Role before but it didn't work. I think I made some errors with the namespaces of the files...
I thought about using a "simple" require but I can't stand the thought of using something that's not included in the Framework. I mean where's the point in using it if you just write the code like you did before?
Another error I made was calling make_immutable on the controller-class which results in an error because inheritance is not working after calling it (no sureprise, if I think about it ;( ).
Here's the part of my programm which includes the other class (as a role) and then calles the corresponding config_module sub in the inherited class.
sub load_config {
my $self = shift;
my $to_load = shift;
with "LaborBelege::AddOns::$to_load\::main";
$self->config_module();
}
Thanks for your advice, it finally got me on the right track.
Greetings from Germany,
Shinama
---------------------------------------------------
"You read too much and understand too little."
Moiraine Damodred (The Wheel of Time)