hi i need a cgi script that will take 5 values submitted by a form and out them on one line serperated by commas in a text file like this

value1,value2,value3,value4,value5
value1,value2,value3,value4,value5
value1,value2,value3,value4,value5

and if if "value1" already exists in the text file then it replaces that line with the line being submitted! thanx

ps i have no idea how to install a cgi so please tellme as well