in reply to JavaScript in CGI

Another very convenient format to use in CGI scripts is the "Here" document, as described, for example, in the Camel Book Programming Perl, 3rd edition, pp. 66-67. The glossary in that book comments that "in Perl here documents are just a fancy form of quoting."

In your case something like

print <<EOF; <p><h1>Your form was sent.</h1></p> <a href="javascript:history.back()">Back to the form</a> EOF

where the 'terminator' of the "here" document is defined by the word after the << and the text between that line and the terminating line (in this case
EOF
on a line by itself in the first column, followed immediately by a return) is printed unchanged, including the internal quotes AND the return at the end of each line (so you don't have to put the "\n" stuff in).

This format makes it much easier to work with HTML code in the midst of Perl, at least until you are ready for templates and separating the HTML display code entirely from the Perl logic.

Live in the moment