in reply to my program will run on my computer but not in CGI

Make sure you use warnings and use strict, and than, when you try to run it as a CGI program, look at the server's error log (there is one, right?)