You could try replacing your login code w/
WWW::Yahoo::Groups -- just use it to login, and then go wherever you need from there (it uses a
WWW::Mechanize object underneath). This way you don't need to maintain the login part yourself:
my $y = WWW::Yahoo::Groups->new();
$y->login( $user => $pass );
# use ->get() which wraps ->agent->get():
$y->get( $your_desired_url );
# or get the agent (a WWW::Yahoo::Groups::Mechanize
# object, which is a subclass of WWW::Mechanize)
my $mech = $y->agent;
# and do whatever with it.
$mech->get( $your_desired_url );
At the least, it might help you diagnose the login problem .. (does WWW::Yahoo::Groups also fail? Does it provide any useful errors?)