in reply to Modules that get along with use lib

There's almost always a way. The methods just get more interesting with certain modules.

Modules like Image::Magick (which is just an interface to some C programs, image libraries, and whatnot) will get *quite* interesting.

Most straight Perl modules should work just fine with the 'use lib' directive. If the module needs to load other modules, the @INC array is globally prepended by your 'use lib' line, right Monks? So as long as all the required modules live in your own personal module directory, you're fine.
  • Comment on Re: Modules that get along with use lib

Replies are listed 'Best First'.
Re: Re: Modules that get along with use lib
by Biker (Priest) on Oct 24, 2001 at 20:15 UTC

    ...the @INC array is globally prepended by your 'use lib' line, right Monks?

    I honestly don't know, but otherwise the following should do it:

    BEGIN{unshift(@INC,'.');}

    f--k the world!!!!
    /dev/world has reached maximal mount count, check forced.

Re: Re: Modules that get along with use lib
by Aighearach (Initiate) on Oct 25, 2001 at 12:18 UTC
    Modules like Image::Magick (which is just an interface to some C programs, image libraries, and whatnot) will get *quite* interesting.
    I would imagine that the C libs wouldn't be there, and that you'd have to build imagemagick with
    ./configure --prefix=$HOME make make install
    Then of course, the system doesn't know where to find your libs...
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HOME}/lib ldconfig
    Then you'd need to build the Perl interface...
    cd /path/to/Image_Magick perl Makefile.pl PREFIX=${HOME}/lib/perl5 make make install
    Of course then when the webserver (probably user nobody) tries to run it... might not find the libs... depending...

    So the CGI might start:

    #!/usr/bin/perl -t use strict; use lib '/home/myhome/lib/perl5'; $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH}.'/home/myhome/lib'; use Image::Magick;
    Yeah, that might be... "interesting."
    --
    Snazzy tagline here