Interpolative Context
We mentioned earlier that double-quoted literal strings do
backslash interpretation and variable interpolation, but that
interpolative context (often called “double-quote context” because
nobody can pronounce “interpolative”) applies to more than just
double-quoted strings. Some other double-quotish constructs are the
generalized backtick operator, qx//; the pattern-match operator, m//; the substitution operator, s///; and the quote regex operator,
qr//. The substitution operator
does interpolation on its left side before doing a pattern match and
then does interpolation on its right side each time the left side
matches.
Interpolative context only happens inside quotes, or things that work like quotes, so perhaps it’s not fair to call it a context in the same sense as scalar and list contexts. (Then again, maybe it is.)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access