jwlarson3rd has asked for the wisdom of the Perl Monks concerning the following question:

am trying to install Tk. I don't have root permission so I have to install it in my home directory. when I run make test I get all kinds oferrors. I have a simple script which checks installation. I am on a linux 2.4.25-ow1
perl -V Characteristics of this binary (from libperl): Compile-time options: USE_LARGE_FILES Built under linux Compiled at Oct 16 2002 12:53:28 @INC: /usr/lib/perl5/5.8.0/i386-linux /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl . #!/usr/bin/perl use strict; print "Content-type: text/plain", "\n\n"; use CGI::Carp qw(fatalsToBrowser); use lib '/home/bthcraft/modules/Tk-804.027'; use Tk; print "\@INC is @INC\n";
with the following error Can't locate Tk/Event.pm in @INC I have reinstalled several times I don't understand the problem because Event is a directory in Tk-804.027 with Event.pm in it john larson

Replies are listed 'Best First'.
Re: perl Tk installation problems
by zentara (Cardinal) on Jun 02, 2004 at 21:24 UTC
    I think your problem is that "use lib 'whatever' " expects all the modules to be directly under 'whatever' and named accordingly. What you should do is add '/home/bthcraft/modules/Tk-804.027' to your PERL5LIB in your .bashrc (or whatever you use). That will put it in @INC
    PERL5LIB=$PERL5LIB:/home/bthcraft/modules/Tk-804.027 export PERL5LIB

    Also when you install, you should use that directory in the perl Makefile.PL step:

    perl5 Makefile.PL PREFIX=/home/bthcraft/modules/Tk-804.027
    If you are installing a binary package, you might have to adjust your directory structure.

    I'm not really a human, but I play one on earth. flash japh
Re: perl Tk installation problems
by eserte (Deacon) on Jun 03, 2004 at 09:03 UTC
    If you had only built Tk in your private directory but did not install it, then you should use the blib pragma instead of lib:
    use blib '/home/bthcraft/modules/Tk-804.027'; use Tk;