I would suggest that you should try simple LWP first and if you realize that the authentication is complex (more than just setting user and password in the standard brower user/password window) to use WWW::Mechanize.
Your code should look like this:
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->proxy(
, 'http://proxy.sn.no:8001/');
$ua->credentials(
'servername:portnumber',
'realm-name',
'username' => 'password'
);
Have a look at http://lwp.interglacial.com/ch11_03.htm.
If you use Windows, then you may also have issues with the SSL module as it is not always included in the distribution.