in reply to How do I use a JavaScript script in Perl-CGI?

You want to do the following:
<html> <head> <script src="yourscript.js"> </script> </head> </html>
See this document for more details.