Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: Re: Re: How to interpret this Perl Tk.pm error?

by newbie00 (Beadle)
on Dec 14, 2001 at 03:40 UTC ( [id://131829]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: How to interpret this Perl Tk.pm error?
in thread How to interpret this Perl Tk.pm error?

Thanks for your reply.

I just want to create a 'Windows'-type environment for the visitors of my website.

I was looking for a way whereby each user would NOT have to set the $Display var on their individual terminals. I also needed to be able to have this graphical interface to be available to various platforms.

My understanding now, is that it is not that simple and using this interface in this uncontrolled arena may possibly open up a security 'hole' (I'm not exactly sure how, but may provide access to the shell?).

What are your thoughts?

Thanx. --newbie00

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: How to interpret this Perl Tk.pm error?
by Chmrr (Vicar) on Dec 14, 2001 at 04:31 UTC

    The key word that you hadn't used before is website. Tk is meant to be used to make graphical front-ends to non-CGI Perl programs -- say, like a Perl/Tk program that allows one to converse in the Chatterbox. Tk really has nothing to do with HTTP. If you're dealing with a website, chances are that you want something that's closer to CGI.pm or one of the many frameworks off of that. Thosewill allow you to have buttons and forms in your webpages. If you want to be able to open multiple windows and have more real-time feedback, Perl is likely not the solution; Java, JavaScipt, and Flash are more up that alley.

    perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

      Thanks so much.

      Had I known that 'website' was 'key' to this (and therefore http), I guess I would have obtained different reponses.

      I read about Tk in several Perl books. All it mentioned is that Tk provides Perl with the ability to provide a graphical interface vs text only. It showed how to write scripts, and provided the benefits and install procedures. None of the references mentioned anything about 'XWindows', 'rc files' or that it is not available for websites! Had I known this, I could have moved on sooner.

      I was looking for an alternative to Javascript and Java due to their drawbacks (Javascript can be turned on/off by visitors, plus the differences between browsers AND JAVA's slow loads and high memory resource requirements). Therefore, I was looking for a server-side and Perl solution.

      Well, I guess it's back to the drawing board with Javascript if I decide to create that graphical interface in the future.

      Thanks for your help.

      -- newbie00

      P.S. Just to close out this topic, I would like to see what Tk looks like -- do you know where I can locate the file and provide the complete syntax so I can set the $Display var and whatever else for Windows 98 (for my computer) I may need, judging by the error message I received? The script will be running on UNIX BSDi using Perl 5.005_03 for now. (if I am not asking this setup question correctly due to by 'newbieness', please let me know.) Again, thanx.

        Tk isn't XWindows-specific, and the only reason 'rc files' were brought up is because people were under the impression that you were attempting to do something quite different than what you though you were asking. Here's the skinny on Tk:

        Tk is a tool that allows you to make applications with graphical interfaces. Note that "Perl application" need not equal "CGI program on a webserver." In the case of Tk, it makes local, window-based applications. Perhaps a tip-off that it can't be used with websites is that Tk is never mentioned anywhere close to 'CGI,' 'webserver,' 'webpage,' 'http,' or 'online.'

        Let's take a real-world example. I wrote a bunch of command-line tools to deal with putting together and editing large numbers of data files for a complicated piece of modelling software. On their own, they do exactly what they need to do; someone can pop up a DOS window or a UNIX prompt and run the programs, and they work fine. But many Windows users are used to having the kind of graphical interface that you're talking about -- so I put together a Tk version of the programs. Now people can double-click the icon, and get a nice set of windows that allow them to point and click to change all the settings, instead of the "clumsy" command line tools.

        As a general aside, you can't use server-side tools to control how the client-side interface works -- as the names imply, they're seperate beasts. The three alternatives that I mentioned all are client-side -- that's what gives them the ability and power to muck around with what the viewer sees and does.

        Your last question is about how to play around with Tk. Unfortunatly, you can't run the Tk script on a remote Unix computer and have it show up on a Windows computer. If your local machine were Unix-based, you might have been able to finesse it (that's what all the talk about the DISPLAY variable was) You're probably much easier off running it locally, though. Install a Windows-based Perl, like ActivePerl, and install the Tk package ('ppm install Tk' from a command prompt). Running the 'widget' program from a command prompt should show you some good examples of what Tk can do.

        perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://131829]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-03-28 22:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found