in reply to REGEX: muliple search and replace

Something like the following has worked well for me:
$ThisText = 'Lame webpage title.'; $ThatText = 'Lame webpage content.'; print <<END_OF_HTML; Content-type: text/html <HTML> <HEAD> <TITLE>$ThisText</TITLE> </HEAD><BODY> $ThatText </BODY></HTML> END_OF_HTML
The "here-document" multiline quote is interpolating, so the strings are substituted correctly without resorting to regular expressions. When the 'template' is large, I just put it, along with its print statement in a separate file. I then slurp the file into a variable and eval it. The variables still scope and interporlate correctly. Now there may be security ramifications for not doing it this way. If so, perhaps someone can set me straight.