in reply to Don't know how to make a module for this repeating code
If values are hardcoded, then why not just:my $formType = "HR-Recruitment"; # hard coded my $lastVerion = "hr_re_v12"; # hard coded eval "use parent 'somepack::$formType::$lastVersion';";
Answering your question, I would probably wrote a function to generate a package from the name and data unique to this package, and then just generate all the packages. Details depend on your particular case. Have a look onto Class::MOP::Class, and Moose::Meta::Class, though you can do it without Moose too.use parent 'somepack::HR-Recruitment::hr_re_v12';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Don't know how to make a module for this repeating code
by exilepanda (Friar) on Nov 24, 2012 at 17:06 UTC | |
by Anonymous Monk on Nov 25, 2012 at 10:21 UTC | |
by exilepanda (Friar) on Nov 27, 2012 at 05:24 UTC |