Skip to content

Commit f17bc21

Browse files
committed
tell that undefined values raise control exceptions in interpolations
1 parent fc5b370 commit f17bc21

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

doc/Language/quoting.pod6

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ You can also use unicode names with C<\c[]>.
147147
dd $s;
148148
OUTPUT«Str $s = "Str $s = "Camelia 💔 my ❤!"␤»
149149
150+
Interpolation of undefined values will raise a control exception that can be
151+
cought in the current block with
152+
L<CONTROL|https://docs.perl6.org/syntax/CONTROL>.
153+
154+
sub niler {Nil};
155+
my Str $a = niler;
156+
say("$a.html", "sometext");
157+
say "alive"; # this line is dead code
158+
CONTROL { .die };
159+
150160
=head2 Word quoting: qw
151161
X<|qw word quote>X«|< > word quote»
152162

0 commit comments

Comments
 (0)