Results 1 to 12 of 12
  1. #1

    2Hit6's Avatar
    Member Since
    Dec 13, 2007
    Location
    Toronto, ON
    Posts
    72
    Specs:
    White MacBook | Core2Duo 2.2GHz | 4GB RAM | 120GB HDD | OS X 10.6.2
    Perl/Tk for OS X?
    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.

  2. #2

    jdgti's Avatar
    Member Since
    Mar 14, 2005
    Location
    Atlanta, GA
    Posts
    443
    Specs:
    17" Macbook Pro Unibody 2.66 Ghz and Powerbook G4 1.67 GHz 2.0GB RAM
    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.

  3. #3

    2Hit6's Avatar
    Member Since
    Dec 13, 2007
    Location
    Toronto, ON
    Posts
    72
    Specs:
    White MacBook | Core2Duo 2.2GHz | 4GB RAM | 120GB HDD | OS X 10.6.2
    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.

  4. #4


    Member Since
    Feb 27, 2009
    Posts
    1
    unfortunately the information there no longer works for 10.4, even with the developer tools, X11 and other attempts like ActivePerl installed.

  5. #5


    Member Since
    Sep 11, 2008
    Posts
    61
    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

  6. #6


    Member Since
    Sep 11, 2008
    Posts
    61
    *** 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

  7. #7


    Member Since
    Aug 31, 2009
    Posts
    1
    Possible Tk issue fixed for Snow Leopard
    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

  8. #8


    Member Since
    Sep 11, 2008
    Posts
    61
    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

  9. #9


    Member Since
    Sep 06, 2009
    Posts
    1
    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?

  10. #10

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

  11. #11


    Member Since
    Sep 11, 2008
    Posts
    61
    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

  12. #12


    Member Since
    Nov 10, 2009
    Posts
    1
    I tried Tk-804.028_501 on Snow Leopard. But the "make test" give me this:
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to install Perl
    By Everett in forum OS X - Development and Darwin
    Replies: 3
    Last Post: 06-13-2013, 12:13 PM
  2. Perl script
    By Vanya98 in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 04-07-2010, 07:25 PM
  3. Perl script error
    By icue in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 09-09-2009, 02:39 AM
  4. Perl
    By Destructive in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 10-22-2007, 01:49 PM
  5. Learning Perl
    By jasihn in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 08-04-2003, 10:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •