in reply to Using Perl to Test a Web App that uses Javascript
This has been covered many times before. You don't need to try and run the JavaScript any more than you need to try and render the HTML. The server only sees the HTTP interaction, so all you need to do is mimic what your browser actually sends to the server.
As it happens, you're in luck, because there is a recent article about how to capture this HTTP interaction with minimal effort:
In Section
Seekers of Perl Wisdom