If I understand your question correctly, you are trying to run a Tk script as a cgi application. You can't do it. The very best result you could possibly get( and you would be lucky to to do it), would be to launch the Tk app on the server's X-window monitor(assuming the server even has X going), running under the user apache(or whatever the webserver is).
So basically don't try to run Tk (or any GUI code) as a cgi script. It's not that it's a bad idea, but you would need a browser plug-in, like the java browser plug-in, to make it work. I really would like to see such a browser plug-in for Perl , but there isn't one yet.
I'm not really a human, but I play one on earth.
flash japh