Skip to content

Commit 598f746

Browse files
Altai-manJJ
authored andcommitted
Update independent-routines.pod6
Closes #3730 Closes rakudo/rakudo#4061
1 parent 7490425 commit 598f746

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

doc/Type/independent-routines.pod6

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ This can be overridden in any of several ways:
3636
use MONKEY; # shortcut that turns on all MONKEY pragmas
3737
use Test;
3838
39+
my $init = 0;
40+
my $diff = 10;
41+
my Str $changer = '$init += ' ~ $diff; # contains a Str object with value '$init += 10'
3942
# any of the above allows:
40-
EVAL "say { 5 + 5 }"; # OUTPUT: «10␤»
43+
EVAL $changer;
44+
EVAL $changer;
45+
say $init; # OUTPUT: «20␤»
4146
4247
In case the C<MONKEY-SEE-NO-EVAL> pragma is not activated, the compiler will
4348
complain with a C<EVAL is a very dangerous function!!!> exception. And it is

0 commit comments

Comments
 (0)