http://www.perlmonks.org?node_id=92844


in reply to how do I set a cookie and redirect

Just print the headers like so:
print "Set-Cookie: name=value; path=path; domain=domain; expires=expir +es;\n"; print "Location: http://whatever.net\n\n";