in reply to form mail with post, getting "premature ending of script headers"
You are working from a bad model.
use CGI; to parse cgi data.
You should look at the nms version of formmail.pl.
After Compline,Zaxo