faro has asked for the wisdom of the Perl Monks concerning the following question:
Greetings monks. I have this piece of code:
I would like to put the modules loading dinamically: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();
oreval { use "$module" };
Somehow i'm not getting this to work, any tips ? Thanks in advanceeval { require "$module" };
Back to
Seekers of Perl Wisdom