Perl : embedding java script with cgi perl script

Hi All,

I am aware that html tags can be embedded in cgi script as below.. In the same way is it possible to embed the below javascript in perl cgi script ??

print("<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">");
print("<input type = "text" name="message">");
print("<input type = "password" name="password">");
print("<input type="submit" name = "submitbutton" value=" Edit ">");
print("</form>");

Now how to embed the below html with script in perl cgi ?

<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">
<input type = "text" name="message">
<input type = "password" name="password">
<input type="submit" name = "submitbutton" value=" Edit ">
</form>
<script>
function submitForm(s) { // when submit form button pressed
var pwd = document.forms[0].password.value;
if (pwd != 1111) {
alert ("Wrong Password! Your greedy has given up! ");
return false;
}}
</script>

May be like this?

print <<'SOMEJAVASCRIPT';
<form action="action.htm" method="post" onSubmit="return submitForm(this.Submitbutton)">
<input type = "text" name="message">
<input type = "password" name="password">
<input type="submit" name = "submitbutton" value=" Edit ">
</form>
<script>
function submitForm(s) { // when submit form button pressed
var pwd = document.forms[0].password.value;
if (pwd != 1111) {
alert ("Wrong Password! Your greedy has given up! ");
return false;
}}
</script>
SOMEJAVASCRIPT