how do u write a perl/cgi program..which makes a page that prompts users to fill a form with the following fields:

username
surname
first name
password
email address

i already made the webpage with the form documents but i dont know the CGI bit....

If any of the fields are left empty, an appropriate message should be displayed.

If all fields are entered successfully, the information should be stored in a text file called Users.txt

You should verify that no 2 records have the same username, and that no 2 records share the same email(to prevent users from registering 2x).

If registration is successful, the user should be taken to a page which lists the details they have entered.

I realize this is an extremely old post, that has gone left unanswered for close to a year, but if you still need help with that, give me the names of the form fields, and what they are (or link me to your HTML), and I'll help you out with it.