Perl: Writing table values to a file

I have a file like this,

1,a,saurav
2,b,rout

I want to show this file in a perl cgi page table and want to add a column which will contain a text box. There I will give some manual input, which will be written to the existing file(or a new file) in below format.

1|a|saurav|bangalore
2|b|rout|hyderabad

How to do that in CGI Perl ?
Thanks in advance.

Use param() of the CGI module to read user input
see: CGI - search.cpan.org:

If you can provide me the sample code it will be great.