WWW::Mechanize doesn't do javascript, but the other *Mechanize and Selenium modules I mentioned provide a scriptable API but use "normal" GUI browsers to do the real work. Which means they do more or less everything IE/Mozilla/Safari do, including Javascript.