if you want to actually include single quotes in the $str, then escape them:$var = 'foo'; $str = "abc $var def"; print $str; abc foo def
$str = "\'abc $var def\'"; print $str; 'abc foo def'
In reply to Re: Interpolating variables in a string
by perlcapt
in thread Interpolating variables in a string
by saintmike
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |