I need a little help with a CGI script

software development


Okay, here’s the 411 – I downloaded this script “as is” which means sans readme files. Thinking hey, I know a little something something about CGI, I thought I’d give it a whirl. Only I get that dreaded 500 Internal Server Error page when I try to execute it from my browser.

Looking at my error logs, the root of the problem (no pun intended) seems to be that the script is looking for files that I’m either linking to wrong or which simply don’t exist. This is possible – remember, it was a WYSIWYG script with no demo and no support. The script draws to a stop at this line:

use strict;
use Tk;
use Pod::Text;
use Tk::Pod;

Now, I’m not familiar enough with CGI to know what this is referring to. :slight_smile: Right after it, though, are these variables:

my $MAN_PATH = “/users/dovl/local/man”;
my $MAN_PAGE = “/mandovl/diamondMine.dovl”;
my $MAN_VIEWER = “/usr/dt/bin/dthelpview”;
my $LIB_PATH = “/usr/bin/perl/lib”;

To be honest, I don’t think any of them are right. Is there anyone out there who might be kind enough to point me in the right direction? The name of the script is diamondmine. The original file can be found here:

My non-working version is here:

Much thanks to any who read this, even if you can’t help. At least you tried!


“I thought I’d live forever, but now I’m not so sure.”


That is a game that you run on your computer. It is not a CGI script. Basically, its a game for operating systems that have a windows library installed called “Tk” and this game uses that library to play a simple game much like the one that comes with Microsoft Windows (ie Minesweeper). Indeed, if you go to http://www.geocities.com/levengli/ it even says
"Download Perl based minesweeper for UNIX"

CGI stands for common gateway interface and that is how the web server (Apache on dreamhost) communicates with scripts or executable files to generate dynamic content or perform other tasks on the web server machine. Just because you have source in Perl does not make it a CGI script. If you don’t know how to run a Tk script as a CGI script then you will probably have to re-write the script specifically for CGI.

An analogy is that you found a car but you think it’s a boat; To get it to float you’d have to make it bouyant or take it apart and build a boat from it.