in reply to ExtUtils::MakeMaker PREFIX and LIB

If the name of the module is some::long::library, it should end up in $PREFIX/lib/some/long/library and not lib, so what you're asking for is trouble, on the other hand you might want to look into the PM option.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: ExtUtils::MakeMaker PREFIX and LIB
by eXile (Priest) on Apr 09, 2005 at 00:26 UTC
    ok, my question was not very clear, the default I've seen is that libs are installed into something like
    $PREFIX/lib/perl5/5.8.2/some/long/module/name
    instead of
    $PREFIX/lib/some/long/module/name
    Since I'd like to use FindBin to point an executable installed in $PREFIX/bin to the locally installed libs the inbetween 'perl5/5.8.2/site_perl' is kind of awkward in such a situation (while obviously very useful when installing into a default location).

    Anyway, I've added this to my Makefile.PL :

    # if PREFIX is set, set LIB too foreach my $arg (@ARGV) { if ($arg =~ /^PREFIX=(.*)/) { push @ARGV, "LIB=$1/lib"; } }
    not very elegant but kind of works.
      I see. You shouldn't need to worry about that, but you could solve it with something like this (in your program)
      my $lib; BEGIN { my $bin = '$PREFIX/bin'; $bin =~ s~bin$~~; $lib = $Config::Config{sitelib}; $lib =~ s~^\Q$Config::Config{siteprefix}\E~$bin~; } use lib $lib;
      If a user is intelligent enough to make use of the PREFIX argument, he should be intelligent enough to make use of PERL5LIB, definetly something you shouldn't worry about.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.