Charles Bush
2005-07-04 16:59:10 UTC
I'm trying to run my 1st perl/tk program and can't get passed the
"use Tk;" command. I get error, "Can't locate Tk.pm" and if I add a "use
lib" pointer to directory containing Tk.pm, I get error message "Can't
locate loadable object for module Tk::Event". SEE BELOW for actual
scripts and error messages.
Environment: Mac OS x 10.3.8; perl version 5.8.1; Tk directory
Tk-804.027.
Experince level: Used to write lots of perl code, 15 years ago on
Sun/unix. Just wrote my 1st perl code on MAC. This is my first try at
perl/Tk. First try at posting to a newsgroup.
I'm using Binny V A's tutorial,
http://www.geocities.com/binnyva/code/perl/perl_tk_tutorial/. Thanks
Binny.
Any help would be appreciated.
Chuck
=======script i use to make pmdirectory in ~/.cpan/build/Tk-804.027 ====
perl -MCPAN -e shell
cpan> install Bundle::CPAN
cpan> reload cpan
cpan> install Tk
=======================================
================= perl/tk test program called testtk.pl ===
#!/usr/local/bin/perl
use Tk;
my $mw = new MainWindow;#Create the Main Window
my $label = $mw -> Label(-text=>"Hello World") -> pack();
my $button = $mw -> Button(-text => "Quit",
-command => sub { exit })
-> pack();
MainLoop;
==================================
============== error message on running "perl testtk.pl"
Can't locate Tk.pm in @INC (@INC contains:
/System/Library/Perl/5.8.1/darwin-thread-multi-2level
/System/Library/Perl/5.8.1
/Library/Perl/5.8.1/darwin-thread-multi-2level
/Library/Perl/5.8.1
/Library/Perl
/Network/Library/Perl/5.8.1/darwin-thread-multi-2level
/Network/Library/Perl/5.8.1
/Network/Library/Perl .) at testtk.pl line 2.
BEGIN failed--compilation aborted at testtk.pl line 2.
============================================================
===== if I add; use lib "/Users/charlesbush/.cpan/build/Tk-804.027" to
program I get error =============================================
Can't locate loadable object for module Tk::Event in @INC (@INC
contains: /Users/charlesbush/.cpan/build/Tk-804.027
/System/Library/Perl/5.8.1/darwin-thread-multi-2level
/System/Library/Perl/5.8.1
/Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1
/Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level
/Network/Library/Perl/5.8.1 /Network/Library/Perl .) at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk.pm line 13
Compilation failed in require at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk.pm line 13.
BEGIN failed--compilation aborted at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk.pm line 13.
Compilation failed in require at testtk.pl line 3.
BEGIN failed--compilation aborted at testtk.pl line 3.
Undefined subroutine &Tk::Event::CleanupGlue called at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk/Event.pm line 3.
END failed--call queue aborted at testtk.pl line 3.
=====================================================================
"use Tk;" command. I get error, "Can't locate Tk.pm" and if I add a "use
lib" pointer to directory containing Tk.pm, I get error message "Can't
locate loadable object for module Tk::Event". SEE BELOW for actual
scripts and error messages.
Environment: Mac OS x 10.3.8; perl version 5.8.1; Tk directory
Tk-804.027.
Experince level: Used to write lots of perl code, 15 years ago on
Sun/unix. Just wrote my 1st perl code on MAC. This is my first try at
perl/Tk. First try at posting to a newsgroup.
I'm using Binny V A's tutorial,
http://www.geocities.com/binnyva/code/perl/perl_tk_tutorial/. Thanks
Binny.
Any help would be appreciated.
Chuck
=======script i use to make pmdirectory in ~/.cpan/build/Tk-804.027 ====
perl -MCPAN -e shell
cpan> install Bundle::CPAN
cpan> reload cpan
cpan> install Tk
=======================================
================= perl/tk test program called testtk.pl ===
#!/usr/local/bin/perl
use Tk;
my $mw = new MainWindow;#Create the Main Window
my $label = $mw -> Label(-text=>"Hello World") -> pack();
my $button = $mw -> Button(-text => "Quit",
-command => sub { exit })
-> pack();
MainLoop;
==================================
============== error message on running "perl testtk.pl"
Can't locate Tk.pm in @INC (@INC contains:
/System/Library/Perl/5.8.1/darwin-thread-multi-2level
/System/Library/Perl/5.8.1
/Library/Perl/5.8.1/darwin-thread-multi-2level
/Library/Perl/5.8.1
/Library/Perl
/Network/Library/Perl/5.8.1/darwin-thread-multi-2level
/Network/Library/Perl/5.8.1
/Network/Library/Perl .) at testtk.pl line 2.
BEGIN failed--compilation aborted at testtk.pl line 2.
============================================================
===== if I add; use lib "/Users/charlesbush/.cpan/build/Tk-804.027" to
program I get error =============================================
Can't locate loadable object for module Tk::Event in @INC (@INC
contains: /Users/charlesbush/.cpan/build/Tk-804.027
/System/Library/Perl/5.8.1/darwin-thread-multi-2level
/System/Library/Perl/5.8.1
/Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/5.8.1
/Library/Perl /Network/Library/Perl/5.8.1/darwin-thread-multi-2level
/Network/Library/Perl/5.8.1 /Network/Library/Perl .) at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk.pm line 13
Compilation failed in require at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk.pm line 13.
BEGIN failed--compilation aborted at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk.pm line 13.
Compilation failed in require at testtk.pl line 3.
BEGIN failed--compilation aborted at testtk.pl line 3.
Undefined subroutine &Tk::Event::CleanupGlue called at
/Users/charlesbush/.cpan/build/Tk-804.027/Tk/Event.pm line 3.
END failed--call queue aborted at testtk.pl line 3.
=====================================================================