Skip to content

Commit 8fd3ee1

Browse files
committed
Document \qq[] escape in q quoting docs
1 parent 9622e68 commit 8fd3ee1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

doc/Language/quoting.pod6

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,15 @@ There are no backslashes here, only lots of $$$!
117117
No $interpolation {here}!
118118
Just a literal "\n" here
119119
120+
The C<\qq[...]> escape sequence enables
121+
L«C<qq> interpolation|/language/quoting#Interpolation:_qq» for a portion
122+
of the string. Using this escape sequence is handy when you have HTML markup
123+
in your strings, to avoid interpretation of angle brackets as hash keys:
124+
125+
my $var = 'foo';
126+
say '<code>$var</code> is <var>\qq[$var.uc()]</var>';
127+
# OUTPUT: «<code>$var</code> is <var>FOO</var>␤»
128+
120129
=head2 X<Interpolation: qq|quote,qq;quote," ">
121130
122131
=begin code :allow<B L> :skip-test

0 commit comments

Comments
 (0)