in reply to Perl CGI

What marto said plus Test::WWW::Selenium (update: derp, probably WWW::Selenium) is available; especially for testing JS. There is an IDE for most browsers that will mostly write the tests for you as you browse through the actions: http://seleniumhq.org/projects/ide/