I'll re-iterate what
waldner suggests - you should find clues as to what's going on in the error log of your web server.
Some more pointers...
- Add use strict.
- I think CGI::Vars is deprecated. Use param() instead.
- Instead of emitting the header yourself, have CGI do it for you with print header;