in reply to Establish a session to call URL with Perl
You simply need to tell Mech to do whatever “clicking on that hyperlink” would do. This can be easy, or it can be hard. :-)
It’s easy when the hyperlink is a simple href="somewhere" ... all that you need to do is to tell Mech to follow_link(). If it is a button or an image, you can click() it. (Or, if you know what the link is and that it will never change, you can simply send Mech to its destination. However, that approach creates a dependency between your script and the server’s ... if they change their code, your script will break.)
Successful login will undoubtedly work by sending you back a cookie, along with a redirect. Mech can store the cookie and follow the redirect. But, remember to correctly handle the case where the login is not correct, or some kind of server error is thrown, even if you are using “known good” credentials in your program.