Course of Raku / Advanced / More about built-in types / Quoting constructs 🆕 / Quoting adverbs
Quiz — Quoting adverbs
What does the following program print?
my $price = 5;
say qq:!s{costs $price};| 0 | costs 5 |
| 1 | costs $price |
| 0 | costs |
| 0 | costs {5} |
qq normally interpolates scalars, but an adverb written
with a ! turns a feature off. Here
:!s disables scalar interpolation, so $price
is left exactly as written instead of being replaced by
5.
Course navigation
← Quoting adverbs | Heredocs →