in reply to Tk in CGI

Yes, you can do what you want if you are using X-Windows.

The trick is to set the DISPLAY environment variable in the BEGIN block, and xhost + on your X display.

I do this when I want to run the ptkdb perl debugger, which is a Tk application, on my CGI's. I like being able to single step through my program in ptkdb and watch the browser display the results.

I have used this on Linux and HP-UX, it probably works on many other systems, also. The X-Windows requirement makes the approach difficult to deploy widely, but the trick is useful as a programmer's tool.

For more details see Debugging a CGI

It should work perfectly the first time! - toma