Your question is vague. What does "submit a POST request to a dll" mean? Is that something else than doing an HTTP request? And what do you mean by "set a cooking in Perl using http header Set-Cookie= name=value;"? Do you mean you print that line in the HTTP request? That would mean you're using the wrong syntax, as you should be using a colon instead of your first '=' character.
Can you post some actual code (a small self-contained fragment, with all unrelevant pieces removed) explaining what you did, and what you get?