@@ -1430,11 +1430,12 @@ method EVAL(*%_)
1430
1430
= for code
1431
1431
sub EVAL($code where Cool|Blob, :$lang = 'perl6')
1432
1432
1433
- If it is invoked as a method, it actually calls the subroutine form with
1433
+ If it is invoked as a method, it calls the subroutine form with
1434
1434
invocant as the first argument, C < $code > , passing along named args, if any; this
1435
- coerces L < Cool|/type/Cool > C < $code > to L < Str|/type/Str > . If C < $code > is a L < Blob|/type/Blob > , it'll be processed
1436
- using the same encoding as the C < $lang > compiler would: for C < perl6 > C < $lang > ,
1437
- uses C < utf-8 > ; for C < Perl5 > , processes using the same rules as C < perl > .
1435
+ coerces L < Cool|/type/Cool > C < $code > to L < Str|/type/Str > . If C < $code > is a
1436
+ L < Blob|/type/Blob > , it'll be processed using the same encoding as the C < $lang >
1437
+ compiler would: for C < perl6 > C < $lang > , uses C < utf-8 > ; for C < Perl5 > , processes
1438
+ using the same rules as C < perl > .
1438
1439
1439
1440
This works as-is with a literal string parameter. More complex input,
1440
1441
such as a variable or string with embedded code, is illegal by default.
@@ -1447,17 +1448,17 @@ This can be overridden in any of several ways:
1447
1448
# any of the above allows:
1448
1449
EVAL "say { 5 + 5 }"; # OUTPUT: «10»
1449
1450
1450
- In case the C < MONKEY-SEE-NO-EVAL > pragma is not activated, the compiler
1451
- will complain with a C < EVAL is a very dangerous function!!! > exception.
1452
- And it is essentially right, since that will run arbitrary code with the
1453
- same permissions as the program. You should take care of cleaning the
1454
- code that is going to pass through EVAL if you activate the
1455
- C < MONKEY-SEE-NO-EVAL > pragma.
1451
+ In case the C < MONKEY-SEE-NO-EVAL > pragma is not activated, the compiler will
1452
+ complain with a C < EVAL is a very dangerous function!!! > exception. And it is
1453
+ essentially right, since that will run arbitrary code with the same permissions
1454
+ as the program. You should take care of cleaning the code that is going to pass
1455
+ through EVAL if you activate the C < MONKEY-SEE-NO-EVAL > pragma.
1456
1456
1457
1457
Please note that you can interpolate to create routine names using
1458
1458
quotation, as can be seen in
1459
1459
L < this example|/language/quoting#index-entry-%26_(interpolation) >
1460
- or L < other ways to interpolate to create identifier names|/language/syntax#Identifiers > .
1460
+ or
1461
+ L < other ways to interpolate to create identifier names|/language/syntax#Identifiers > .
1461
1462
This only works, however, for already declared functions and other
1462
1463
objects and is thus safer to use.
1463
1464
0 commit comments