It's not that easy. The Javascript function ContestPop() could do many things that are not readily understood by Perl, unless Perl understood Javascript, which it doesn't.
I suggest you learn about HTTP and find out what request is made when you (as a human) click on the Javascript link. For example the Mozilla Live Headers Extension can show you what HTTP requests are made. Most browsers have such tools built into them so you can conveniently analyze what goes over the wire.
After you've found out what data gets send, all that remains is replicating that using Perl.
As an alternative, there are implementations of the WWW::Mechanize API that "understand" Javascript by running the Javascript in a browser. Two examples are WWW::Mechanize::Firefox and WWW::Mechanize::PhantomJS. But these both need the respective browser installed. Also, they still require you to understand the difference between Javascript and Perl, and you will also need to understand where HTTP comes into play.