in reply to Re^2: text has single and double quotes and anychar. how to assign this text?
in thread text has single and double quotes and anychar. how to assign this text?
You can use the double-quote-like here-doc format:
If you have interpolation, you'll have to escape your backslashes no matter what (and you'll need to escape other characters depending on your delimiter), there's no "simple" way to have perl interpolate in some places and take the string litteraly in others. So the next best thing might be to use substitution on the litteral string to replace variables by their value, escape all backslashes in your string, or divide it into several parts and use concatenation: my $string = 'Here \ is allowed'.q<Here I can have '>."This interpolates $var".my $string = <<"END"; # Note here I have used double quotes In this string " and ' and all chars work normally, but backslashes mu +st be escaped, and $var is interpolated. END
|
|---|