in reply to Re^2: Loading a Module from a Variable
in thread Loading a Module from a Variable
One way to avoid use strict and use warnings being inherited by your evaled source is to simply no strict; no warnings; before you eval.
To avoid lexical variables, put the eval() in a subroutine that appears before any file scoped lexicals (and before the pragmas too).
# Start of program sub myeval { eval shift } use strict; use warnings; # ...rest of program
A completely different approach would be to put a code reference into @INC. That way you can actually use require.
|
|---|