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)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.