Front page | perl.perl6.users |
Postings from June 2018
From: The Sidhekin
June 14, 2018 12:21
Message ID: CAHAeAG53niY3SsJbwCE+XPYf6a8UZTazbh=bqkJ77QoPHC_emA@mail.gmail.com
On Thu, Jun 14, 2018 at 8:01 AM, Todd Chester <ToddAndMargo@zoho.com> wrote:
> On 06/13/2018 12:27 PM, Brandon Allbery wrote:
>> use MONKEY-SEE-NO-EVAL;
> Thank you. Someone had fun with that name!
> Do I presume there is not other way around the issue?
That depends on your use case. EVAL/eval is powerful enough it could be
pretty much anything, so bird's-eye view here:
If $RunSpecific is sufficiently non-generic (i.e. couldn't be any code
whatsoever), an approach with dispatch tables or similar (dynamic method
lookup, giant switch ...) might be an alternative. Optionally parsing the
code (Perl subset, DSL?) yourself.
For use with any code whatsoever though, you need that kind of power, and
as Brandon wrote: You get to do your own data sanitization, and you tell
Perl 6 you did so with "use MONKEY-SEE-NO-EVAL;".