in reply to HTTP POST & Cookie

I couldn't try your code because you didn't follow the Writeup Formatting Tips, however you need at least to define a cookie jar where to store your cookies on the client side, for example:

$ua = LWP::UserAgent->new(cookie_jar => $cookie_jar_name);

LWP::UserAgent has much more on the subject of setting up a cookie jar.