When asking for help, it's a good idea to give as much information as possible. It's a good start that you've posted the code, but you don't describe how it isn't working correctly. What have you done to try to fix it? What do your Web server error logs say? What happens when you use
strict and
warnings? I suggest you investigate the
CGI module which allows you to debug CGI scripts from the command line. Whenever you write code, it's a good idea to check for potential errors throughout the code: this makes it easier to determine the cause of any errors that occur.