in reply to use of already eval()ed module (from string)
The typical solution would be to add fake entries to %INC, so require and therefore use thinks the module has already been loaded and doesn't need to be loaded again. If I put $INC{'Test/Module/Hello/Hello.pm'}=1; after the first eval and $INC{'Test/Module/Hello/Goodbye.pm'}=1; after the second, your code seems to run fine, even when I reenable the use lines. (If later parts of your program might depend on it, you might want to add a more useful value to %INC instead of 1.)
An alternative (but equivalent) solution is to put use me::inlined; in each of the packages you're evaling.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use of already eval()ed module (from string)
by bliako (Abbot) on Jan 08, 2019 at 21:42 UTC | |
by haukex (Archbishop) on Jan 08, 2019 at 22:31 UTC |