Mech does not do javascript. You'll have to munge the URL yourself. Or you can try Mozilla::Mechanize or WWW::Mechanize::Plugin::JavaScript or Win32::IE::Mechanize. I don't know javascript either, but so far I've found it's been easy to read well enough to tell what it's doing to the URL so I haven't had to resort to any of those other modules yet.