The form processing in this script is seriously broken. It'll work as long as the person at the browser is kind enough to type alphanumerics, but will break for many other characters. The risk you run is that someone (maybe you) will copy code out of this script later, and will then have to debug it when it doesn't work.
CGI.pm does form processing the right way. Use it.