in reply to limiting scope of 'eval'??
In fact, I'd like to hide from the eval'd code all variables and functions that were declared outside of it. Is this possible?
All 'my' variables can be hidden with the code below, but the others are trickier. If you can take the performance hit, use system to run the code in a seperate interpreter if you can.
# Before any 'my'. Put in a seperate module if necessary. # Use eval_it instead of eval. sub eval_it { eval shift; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: limiting scope of 'eval'??
by ManFromNeptune (Scribe) on Aug 22, 2004 at 03:39 UTC | |
by Prior Nacre V (Hermit) on Aug 22, 2004 at 06:09 UTC | |
by edan (Curate) on Aug 22, 2004 at 08:36 UTC | |
by ManFromNeptune (Scribe) on Aug 22, 2004 at 17:10 UTC | |
by merlyn (Sage) on Aug 23, 2004 at 17:01 UTC |