in reply to Add Javascript file and Javascript code using CGI.pm

I don't fully see your question, but you'll have to add the javascript code, or the link to the source, on the <script> tags to the HTML page. If what you don't like to look at is the HTML inside the Perl script I'd suggest using a template approach. I like Template::Toolkit.