With your updates, I see the problem. You're using the package names without the Foo:: prefix. You're probably best off Foo-izing your submodules during the load and then from there on in, you don't need to worry about it:
Hope that helps,package Foo; sub new { my $class = shift; my @submodules = map { "Foo::$_" } @_; for ( @submodules ) { eval "require $_" || die "$@"; } bless { submodules => \@submodules }, $class; } 1;
In reply to Re: Loading Modules At Run-Time With Interpolation
by Tanktalus
in thread Loading Modules At Run-Time With Interpolation
by Cody Pendant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |