http://qs321.pair.com?node_id=641852

faro has asked for the wisdom of the Perl Monks concerning the following question:

Greetings monks. I have this piece of 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();
I would like to put the modules loading dinamically:
eval { use "$module" };
or
eval { require "$module" };
Somehow i'm not getting this to work, any tips ? Thanks in advance