in reply to Loading Modules At Run-Time With Interpolation
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Loading Modules At Run-Time With Interpolation
by Cody Pendant (Prior) on Aug 12, 2005 at 04:30 UTC | |
|
Re^2: Loading Modules At Run-Time With Interpolation
by Cody Pendant (Prior) on Aug 12, 2005 at 04:35 UTC | |
by Tanktalus (Canon) on Aug 12, 2005 at 04:47 UTC | |
by Cody Pendant (Prior) on Aug 12, 2005 at 05:01 UTC |