in reply to Re: limiting scope of 'eval'??
in thread limiting scope of 'eval'??
And index.pl is (basically):Today is <% $a = localtime(time); print $a; %>
So here, I'd like a user to be able to use their own variables, and not be able to (even accidentily) mess up the calling script's scoped variables/functions.my $a = "important value"; # open flatfile here... # use index and substr to find macro strings delimited with <% ... %> # loop through found macros eval($macro) # replace macro code with eval value # print resulting text # keep using variable $a, expecting the value will still be "important + value"...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: limiting scope of 'eval'??
by Prior Nacre V (Hermit) on Aug 22, 2004 at 06:09 UTC | |
|
Re^3: limiting scope of 'eval'??
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 |