in reply to Mechanize module
Since WWW::Mechanize ISA LWP::UserAgent, you can use the methods as described in lwpcook, to achieve that goal.