in reply to Re: OS X ElCaptain Activeperl Tk
in thread OS X ElCaptain Activeperl Tk

I get the same Error with your code (good point to keep it so simple). My code was:

#!/usr/bin/perl -w # Display Hello World program use Tk; use strict; my $mw = MainWindow->new; $mw->geometry("200x100"); $mw->title("Hello World!!!"); $mw->Label(-text => 'Hello World')->pack(); $mw->Button(-text => "Close", -command =>sub{exit})->pack(); MainLoop;

Tk was installed with ppm so I really thought I was on the safe side... but no. Do I have to install codeX to make it run? I do not think is the case. I also tried a mini script with Tkx (which comes with Activestate already installed) and it works fine. What can I try?

Replies are listed 'Best First'.
Re^3: OS X ElCaptain Activeperl Tk
by Marshall (Canon) on Jun 15, 2016 at 19:00 UTC
    I am running a "clean install" of Active State 5.20 for Windows on a laptop - no additional ppm installs. The result is that your script works just fine - no problem. I do not have a Mac, but I've given Tk code before to folks who do and it works fine (although that was before 5.22).

    I confess to being flummoxed at this point.

    Update: Oh, since latest Mac OS'es are linux like, there may be a path problem between this new latest AS installation and the system's idea of Perl? What does Perl -V show?

      On Windows I have no problem at all with the combo ActiveState a Tk. perl -v confirms I am using the right perl installation (ActivePerl) and not the default one (coming with the OS X). In this case I have to say, I have less problems on Windows

      Just out of curiosity, as I am working on a Mac to port a Windows Perl/Tk software to OS X. The code written with Perl/Tk on a Windows PC was running fine on a Mac, have I understood you correctly? That would help me to keep on trying... as I am about to give up!

        Been away for awhile, but it appears that you have Tk working now! I don't have to do anything special for the Mac anymore because my Mac guys are power users and they run Windows underneath the Mac OS on some honking machines. How they do this, I don't know. But they can run the Windows .exe that I give to the Windows only guys! So this is good for me as I don't have to worry. But yes, Perl Tk is multi-platform.