It is a real question, I want to be able to do something like that :
sub generate_package {
my ($package_name) = @_;
return q{
package t;
use }.$package_name.q{;
use MooX::Option;
has 'test' => (is => 'ro');
1
}
}
{
eval(generate_package('Moo'));
t->new_with_options();
}I have seen some stuff, like define directly ISA : *{"t::ISA"} = 't';
But how can I add my compiled code ?
If anybody can help me on this, thanks !