Most JavaScript hardly does anything at all as far as the server is concerned, and the server is the only thing that matters here. Just look at the script, figure out what it does (change a form value? submit another form?) and then write Perl code that does the same thing. In many cases, the JavaScript can be ignored completely.