in reply to Re^2: Loading Modules At Run-Time With Interpolation
in thread Loading Modules At Run-Time With Interpolation
You are misdiagnosing the problem. The problem isn't the require. It's where you try to use the details function. For example, both of these will work:
By merging Foo:: directly into your submodules list, we don't need to constantly recreate the full package name each time - it's already created.my $p = 'Foo::Bar'; eval "require $p"; print $p->details->{name}; # ... and ... my $p = 'Bar'; eval "require Foo::$p"; print "Foo::$p"->details->{name};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Loading Modules At Run-Time With Interpolation
by Cody Pendant (Prior) on Aug 12, 2005 at 05:01 UTC |