in reply to Re: ExtUtils::MakeMaker PREFIX and LIB
in thread ExtUtils::MakeMaker PREFIX and LIB

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.

Replies are listed 'Best First'.
Re^3: ExtUtils::MakeMaker PREFIX and LIB
by PodMaster (Abbot) on Apr 09, 2005 at 09:47 UTC
    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.