You cannot interpolate using single quotes, you must use double quotes, or another form of quoting that does interpolate
"par/par1/par2[\@id = $variable]"
However, I assume that @id
is not a variable, so you must escape its sigil, or it will be treated as a variable as well. If you are using use strict
-- which you always should -- this will lead to a compiler error.
The other forms of quoting that might be mentioned
qq()
, which is exactly like double quote- Heredocs