With older versions of Mechanize you could subclass the WWW::Mechanize package and provide your own credentials routine:
package MyMech;
use vars qw(@ISA);
@ISA = qw(WWW::Mechanize);
sub get_basic_credentials {
my ($self, $realm, $uri) = @_;
return( "user", "password" );
}
Then in your program use this package instead of WWW::Mechanize:
package main;
my $mech = MyMech->new();
$mech->get( $url );
Update
You've updated your question to indicate the requirement of NTLM authentication. Check out LWP::Authen::Ntlm on CPAN.