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?
The interpolation will happen with the heredoc. Or, make up your own convention, something that will not appear in the text itself, and use s///.
$variable = 'there'; $string = <<END; Put my variable $variable and !here! END print $string . "\n"; $string =~ s/!here!/$variable/; print $string . "\n";
Output:
Put my variable there and !here! Put my variable there and there
|
|---|