in reply to Some Advice On Eval()-ing code.
...code evaluated with do FILENAME doesn't see lexicals in the enclosing scope like eval STRING does.
In other words, your "$thing_file_dot_inc_needs" variable won't work. Here's another flaw:
...it does reparse the file every time you call it...
It would be better to make the "file.inc" into a module and bring it in with a "use" or "require". Then you are protected from double-inclusion. Lastly, "do" is a heavily-overloaded keyword, also used for loops and subroutines, so it makes the program less clear, IMHO.
|
|---|