in reply to How to use javascript code in Perl?
See my reply at Re^3: LWP::UserAgent, redirection does not work. Basically, you will have to either rewrite the code in Perl or you'll have to embed a Javascript interpreter or use Win32::IE::Mechanize