I think WWW::Mechanize already understands that from the URL provided. I was able to login to a https website (https://mail.yahoo.com) already with the code posted there.
Please read the detailed description of the issues I'm facing and the measures I've taken to debug the issues in my posting. Thanks.