Link to home
Start Free TrialLog in
Avatar of dwcronin
dwcroninFlag for United States of America

asked on

perl window creation problems

i'm using ubuntu 18.04 and i am trying to learn perl and get a window to appear like visual studios where i can create buttons and drop-down boxes, etc and i cannot seem to gt it installed.  i used https://www.perl.com/pub/2001/03/gui.html/ and i cannot get their examples:ptked and ptksh to execute.  these are listed in the paragraph right above: pTk Core Concepts.  is there a better example or do you see what i'm missing?
Avatar of David Favor
David Favor
Flag of United States of America image

Provide steps you used to install the related PERL code (TK modules) + also the errors produced when you attempt to access TK.
That documentation is 19yrs old.  A lot has changed since then so I'd recommend starting out by reading more current documentation.

Tk - a graphical user interface toolkit for Perl
Tk::UserGuide - Writing Tk applications in Perl 5
TkDocs Tutorial
Avatar of dwcronin

ASKER

David Favor and FishMonger: I'm going through the user guide that FishMonger supplied the link to.  I will give further details and results ASAP.
Dan
I was just thinking something similar to FishMonger's comment.

PERL + TK... whew... there might be a much better approach to your project.

If you're doing something simple consider the dialog program which you can call from PERL or BASH or any scripting language.

TK is a very heavy solution for simple projects.
http://perl-begin.org/uses/GUI/ provides a good overview of other options.

Stick with TK or wxPerl if your App must run on many OS types.

Use the dialog program for Linux Apps requiring trivial input.
David Favor:  it's going to only run on my Ubuntu computer.  i just have some spare time and I was trying to write a program for my sister to keep track of the cemetery where she works.  i am also learning perl to search the list of dead people.  thanks for what you said about easier ways than ptk.  i could probably do this in visual studios but i am trying to learn how to make screens in linux.  the code and errors are attached.
error_when_screen_maker_compiled.png
Tk is not a core module.  The error message is telling you that you need to install Tk.  I don't have access to my Ubuntu system right now to confirm this but you should be able to install it with this command.
apt install Tk
Make sure you're logged-in as root when you install it.  Installing it under a non-root account can be done but adds additional complication.

Be aware that learning Perl and Tk together is not the easiest thing to do so depending on your programming background, your learning curve may be steeper than you expect.
ASKER CERTIFIED SOLUTION
Avatar of FishMonger
FishMonger
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i know/knew C, C++, pascal, cobol, basic, vb, vc++, and RAPID.  I got my degrees in physics though.  i'm on disability now so i just  mess around on the web and i thought perl sounded fun to learn.  i just like to write code better in vi or emacs.  i tried to do sudo apt install Tk.  It says "E: Unable to locate package Tk".  I'll try David Favor's suggestion t making a screen first.  I'll be back in a couple days. thank you.
thanks to both David Favor and FishMonger
The name of the package and the case is important.
Try: sudo apt install perl-tk