perlquestion
faro
Greetings monks. I have this piece of code:
<code>
use My::AAA;
use My::BBB;
use My::CCC;
my $module = 'My::' . $name_str;
eval { $obj = $module->new(); };
if ($@) {
print "Error loading module $module: $@\n";
exit;
}
$obj->login();
</code>
I would like to put the modules loading dinamically:
<code>
eval { use "$module" };
</code>
or
<code>
eval { require "$module" };
</code>
Somehow i'm not getting this to work, any tips ?
Thanks in advance
</pre>