in reply to execute JS in http response in perl
Perl itself can't easily execute javascript, but you can for example use WWW::Mechanize::Firefox to automate a firefox which executes the javascript.