New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Perl/Tk for OS X?


Post Reply New Thread Subscribe

 
Thread Tools
2Hit6

 
2Hit6's Avatar
 
Member Since: Dec 13, 2007
Location: Toronto, ON
Posts: 72
2Hit6 will become famous soon enough
Mac Specs: White MacBook | Core2Duo 2.2GHz | 4GB RAM | 120GB HDD | OS X 10.6.2

2Hit6 is offline
I've installed XCode and it came with a lot of nice extras like gcc, etc. However, what I'm really looking for is Perl/Tk, but haven't been able to find any sites with some good information on it. So does anyone know where I can get Perl/Tk for OS X (in my case, Leopard). Thanks.
QUOTE Thanks
jdgti

 
jdgti's Avatar
 
Member Since: Mar 14, 2005
Location: Atlanta, GA
Posts: 444
jdgti will become famous soon enough
Mac Specs: 17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM

jdgti is offline
You have installed the developer tools right? Well, I haven't tried it yet, but I was planning on installing this soon too.

This was the link I found.

http://perlprimer.sourceforge.net/download.html

Tell me if it works for you. I will reply back sometime this weekend with my success or failure. I would go ahead and try it now, but I have a final tomorrow and I want to stay on track.
QUOTE Thanks
2Hit6

 
2Hit6's Avatar
 
Member Since: Dec 13, 2007
Location: Toronto, ON
Posts: 72
2Hit6 will become famous soon enough
Mac Specs: White MacBook | Core2Duo 2.2GHz | 4GB RAM | 120GB HDD | OS X 10.6.2

2Hit6 is offline
I successfully installed Perl/Tk with the instructions here: http://www.lehigh.edu/~sol0/Macintosh/X/ptk/

I just used the one for Tiger even though I have Leopard and it works fine.
QUOTE Thanks
m_for

 
Member Since: Feb 27, 2009
Posts: 1
m_for is on a distinguished road

m_for is offline
unfortunately the information there no longer works for 10.4, even with the developer tools, X11 and other attempts like ActivePerl installed.
QUOTE Thanks
Konan

 
Member Since: Sep 10, 2008
Posts: 61
Konan is an unknown at this point

Konan is offline
Here is a how-to for Leopard. I just did this on my new Imac and it works. I am still a Mac newbie, but have been using Unix/Linux for decades and Perl-Tk for years. You can make really neat, small and fast gui programs with Tk without all the overhead of the super suites like Netbeans.

First, go to cpan.org and download Tk-804.028 by selecting modules and doing a search. It is about 6 meg and comes as a tar/gz file. No problem, Leopard will recognize it. Unzip it.

Make sure that you have Xcode tools loaded and definitely the Unix development part of it. Since Leopard is on top of FBSD Unix, Tk can definitely be installed without Xcode - I just don't know how yet on a Mac. I am afraid that at the my current level of knowledge of Leopard that I might totally unhook the GUI from the OS. But, the following way works fine.

Now, open a terminal session and move into the folder that you have unzipped Tk into.

Give the following commands without the quotes (note: case sensitive!) ...

"perl Makefile.PL" This will take just a short while.

"make" This will take several minutes. Don't panic if you think you see warnings and errors go by. That is normal for Unix.

"make test" Now you will see examples appear as it tests the compile. Again, don't worry if it says that it failed some tests when it is done. I have never seen an install that gives a 100 percent pass even on a pure Unix machine.

So far, nothing done has changed anything on your machine. You can dump this folder and everything is gone. Or even run the process again if you want to watch it again.

The following will install the compiled TK on your machine.

"sudo make install" It will ask for your password and then install in a few seconds.

Thats it. Just be sure that you put the line...
use Tk;
in your perl program.

Also, you HAVE to have the book, "Mastering Perl/Tk" (by Lidie and Walsh) if you are serious about Tk. (BookFinder.com: Search for New & Used Books, Textbooks, Out-of-Print and Rare Books) Don't even try programming Tk without this book. It has Everything that you can do with Tk and is actually understandable by a Tk newbie.

Konan
QUOTE Thanks
Konan

 
Member Since: Sep 10, 2008
Posts: 61
Konan is an unknown at this point

Konan is offline
*** Warning ***

Snow Leopard breaks Perl/Tk big time. If you have a pre-SL production machine that has to run Tk, don't upgrade yet. So far, after a day of hacking, I have finally managed to get Tk installed, but not totally working.

Konan
QUOTE Thanks
aholtz

 
Member Since: Aug 31, 2009
Posts: 1
aholtz is on a distinguished road

aholtz is offline
I have just installed the following developer beta from PerlTk under Snow Leopard and it fixed my problems:

Slaven Rezić / Tk-804.028_501 - search.cpan.org

I was getting the "no event type or button # or keysym <snip> Widget.pm ..." error on my programs after building the 804.028 release version.

Just ungzip/untar and do a standard perl Makefile.PL; make install
QUOTE Thanks
Konan

 
Member Since: Sep 10, 2008
Posts: 61
Konan is an unknown at this point

Konan is offline
Great. That fixed it for my Snow Leopard also.

I finally got the old version to running by using the old GCC and library, but it is a temporary and fragile solution that any update would probably break.

This is much better. Now I can move to SL permanently.

If he had a donate button, I would gladly contribute.

Thanks
Konan
QUOTE Thanks
Lunenburg

 
Member Since: Sep 06, 2009
Posts: 1
Lunenburg is on a distinguished road

Lunenburg is offline
Quote:
Originally Posted by aholtz View Post
I have just installed the following developer beta from PerlTk under Snow Leopard and it fixed my problems:

Slaven Rezić / Tk-804.028_501 - search.cpan.org

I was getting the "no event type or button # or keysym <snip> Widget.pm ..." error on my programs after building the 804.028 release version.

Just ungzip/untar and do a standard perl Makefile.PL; make install
I'm trying to build Perl/Tk on my SL box, downloaded Tk-804.028_501, did the standard build, but I'm still getting

Code:
no event type or button # or keysym at /Library/Perl/5.10.0/darwin-thread-multi-2level/Tk/Widget.pm line 1105.
It seems to be triggered by this:

Code:
# Main display area - search results
our $searchboxframe = $mw->Frame();
$mainbox = $searchboxframe->Scrolled(
    'HList',
    -scrollbars       => 'osoe',
    -background       => 'white',
    -selectbackground => 'navy',
    -selectforeground => 'white',
    -width            => 100,
    -selectmode       => "extended"
  )->pack(
    -fill   => 'both',
    -expand => 1,
    -side   => 'top'
  );
Any thoughts on what I might try?
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,827
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
Why not use something like MacPorts to compile Perl/TK? I think the package you want is p5-tk. According to the description in the aforementioned link, it is "a Perl interface to Tk".

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
Konan

 
Member Since: Sep 10, 2008
Posts: 61
Konan is an unknown at this point

Konan is offline
Quote:
Originally Posted by vansmith View Post
Why not use something like MacPorts to compile Perl/TK? I think the package you want is p5-tk. According to the description in the aforementioned link, it is "a Perl interface to Tk".
I was looking at p5-tk when I was having problem with PerlTK. But I could not find a single solitary site with info/manuals/docs about the package. And it appears that it is what Linux people call an 'orphaned' package. That is, there appears to be no maintainer of the code which to me, means that it is dead.

Didn't want to base my programming around a key module that may or may not disappear tomorrow.

Konan
QUOTE Thanks
koichi

 
Member Since: Nov 10, 2009
Posts: 1
koichi is on a distinguished road

koichi is offline
I tried Tk-804.028_501 on Snow Leopard. But the "make test" give me this:
Quote:
dyld: lazy symbol binding failed: Symbol not found: _png_create_write_struct
Referenced from: /User/k/perl/Tk-804.028_501/blib/arch/auto/Tk/PNG/PNG.bundle
Expected in: flat namespace
And I cannot open PNG image files in Perl/Tk windows.

I installed libpng separately, but no luck.

Any help or hints please?

Thanks and sorry for my poor English.
QUOTE Thanks

Post Reply New Thread Subscribe


« iPhone Developer Program on PowerPC G4 | Ccode C++ input file »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

All times are GMT -4. The time now is 04:44 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?