#!c:\\perl\\bin use strict; use WWW::Mechanize; use HTTP::Cookies; use LWP::Debug qw(+); my $outfile = "out.htm"; my $url = "https://mail.yahoo.co.in.com/"; my $username = "rspy_sedam"; my $password = "xxxx"; my $mech = WWW::Mechanize->new(); $mech->cookie_jar(HTTP::Cookies->new()); $mech->get($url); $mech->form_name('login to yahoo!'); $mech->field(login => $username); $mech->field(passwd => $password); $mech->click(); $mech->follow_link(text => "click here", n => 1); my $output_page = $mech->content(); open(OUTFILE, ">$outfile"); print OUTFILE "$output_page"; close(OUTFILE);