in reply to saving data locally in CGI script?

You need to send a header in response to the submit which defines your content as a csv text file. You can use the following
Content-type:text/csv\n\n

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."