... or just use WWW::Mechanize, which also does the cookie handling transparently.
In reply to Re^2: POSTing information on a web page by Corion in thread POSTing information on a web page by clone4