S02 provides this example for treating curlies literally in a quoted string:
qq:!c "Here are { $two uninterpolated } curlies";
But can I escape them with a backslash? I was surprised that I couldn't
find anything in S02 which said either yes or no. Perhaps this falls
under the heading of "anything not specifically defined in the synopses
acts just like it did in Perl 5", and I should just shut up.
In the description of the :q (aka :single) adverb, there is mention of
the fact that you can escape the quoting character, as in
Q :q "The ubiquity of \"air quotes\" is really annoying to me";
and the description of :b (aka :backslash) indicates that it activates
the usual substitutions on \a, \b, \t, \n, \f, \r, and \e,
Q :b "Here's a BEEP \a and a newline \n;
but I can't find any discussion of whether "\p" is legal (presumably
identical to "p") or lexically illegal ("unrecognized escape sequence in
string literal"). And in that example, by p I mean any character p for
which S02 doesn't define the meaning of \p.
In particular, there's no mention of whether \ can be used to escape $,
@, %, &, or {. I would _assume_ that
"Here are \{ $two uninterpolated \} curlies";
means the same as the first example, above, but I can't find anything
that says so.
So, I would hope that
$fruit = 'apple';
$number = 7;
$money = 'peso';
say "set A = \{ $fruit, {$number+1}, \$money \}";
actually says
set A = { apple, 8, $money }
Does it? And, do I really need to backwhack the final (closing) curly?
say "set A = \{ $fruit, {$number+1}, \$money }";