develooper Front page | perl.perl6.users | Postings from June 2018

Re: EVAL?

Thread Previous | Thread Next
From:
Brandon Allbery
Date:
June 14, 2018 17:31
Subject:
Re: EVAL?
Message ID:
CAKFCL4WDYJ9_=tX=1HWFcrYxSBF_gqgxX3FWzv2ST4gun8SOgg@mail.gmail.com
In short, pragmas are all-same-case "use" names; instead of loading code,
they tell the compiler to change its behavior.

The MONKEY-* pragmas generally control various kinds of unsafe or dangerous
behavior, including direct access to the mechanisms underneath /
"supporting" Rakudo and things like EVAL. Other all-uppercase names also
generally represent "dangerous" actions or options.

There are a few pragmas that are all lowercase instead of all uppercase;
they also change the compiler's behavior, but are safer than the
all-uppercase ones. "use lib" is one of them. (This is why modules are
generally mixed-case names.)

https://docs.perl6.org/language/pragmas for more information.

On Thu, Jun 14, 2018 at 1:22 PM ToddAndMargo <ToddAndMargo@zoho.com> wrote:

> On 06/13/2018 12:27 PM, Brandon Allbery wrote:
> > Exactly what it says: eval is a code injection attack waiting to happen.
> > If you actually need it, you get to do your own data sanitization, and
> > you tell Perl 6 you did so with "use MONKEY-SEE-NO-EVAL;".
>
> Hi Brandon,
>
> Thank you for clarifying.  My hand up with the error message
> was its wording:
>
>         "use the MONKEY-SEE-NO-EVAL pragma to override this error"
>
> 1) I did not realize the the word "use" mean the Perl "use".
> I though it meant the English usages as in go do something.
>
> 2) what the heck is a "pragma"?  Way to obscure.
>
> Your response cleared up the misunderstanding nicely.
>
> -T
>


-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About