Khatri has asked for the wisdom of the Perl Monks concerning the following question:

When I click on the button on p1.pl web-page, what It suppose to do is "create new small window using this tk" I had wrote some code using Tk. When I run code "particularly the part that create new window; it works if I run it on the prompt but using the web-page......can't open it and it looks like it just keep trying to open that page"
$perl =~ s/$difficult/$easy/g;
  • Comment on Tk create new window on the fly Question

Replies are listed 'Best First'.
Re: Tk create new window on the fly Question
by zentara (Cardinal) on Feb 11, 2006 at 12:44 UTC
    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
Re: Tk create new window on the fly Question
by spiritway (Vicar) on Feb 11, 2006 at 11:03 UTC

    Hello, [id://Khatri]. I'm not clear what you're asking - something isn't working right with some code you wrote in Perl/Tk? It would be very helpful if you would show what you've done so far, and explain what you want, and what you're getting. Without that, it's very difficult to know where the problem lies.