I need to set and retrieve cookies without using Content-Type: text/html\n\n (without writing anything to the browser page)

Reason- I'm making a semi-secure login page, just need to send a simple form to a *,pl file, process, set or read cookie (as the situation dictates) then print "Location:../home.htm"; got everything working great- but don't know the syntax for setting or reading a cookie strait from perl (I could do it through JavaScript but it wouldn't be very secure)