CGI.pm has a function for creating Javascript on the client. So I would not agree that the question of what Javascript code to use is unrelated to Perl—with CGI.pm Javascript code is expressed in Perl.
I have never used CGI.pm's Javascript writing capability, however.
Comment on Re: Re: making perl scripts play nicely together