Modules and different paths

From: Mark Seger (Mark.Seger_at_hp.com)
Date: 06/28/04


Date: Mon, 28 Jun 2004 16:14:33 -0400

I'm trying to use Compress::Zlib in a script I'm trying to run on a
number of platforms. Depending on which version of Compress and perl
are being used, more often than not it seems Zlib gets installed in a
direction not in the current @INC - the most common being ending up in a
5.6 directory on a 5.8 system or visa-versa and it's driving me and the
users of the script crazy.

The thought I had was in the initialization section to look in specific
known locations to figure out where Zlib ended up and then add that
location to @INC. right? I thought I'd try to be clever and use the
lib module to set INC but to do that at run vs compile time I have to do
it in a require. No problem, or so I thought, but if I can't figure out
the syntax! My thought was since the syntax for 'use' is

use lib 'path';

I could say

require "lib 'path'";

but that doesn't seem to do it. So I guess my multipart question is:
- is this a reasonable way to deal with rpms that install into multiple
locations?
- is the correct way to set my path dynamically to 'require lib' and if
so what is the correct syntax?
- is there a way to get an rpm to install in a directory I want it to
rather than the ones it wants to?

-mark



Relevant Pages

  • Re: OpenBSD 4.2 upgrade to 4.3 breaks kde and konqueror
    ... Script started on Fri May 30 16:34:00 2008 ... Can't install kdelibs-3.5.8p3: lib not found xml2.9.7 ... Somehow it seems like you package manager don't download the files again, sadly I don't know much about the package manager in OpenBSD, I would suggest you take a look at alt.os.openbsd or/and comp.unix.bsd.openbsd.misc. ...
    (comp.windows.x.kde)
  • GD/gdmodule on Win XP
    ... How do I install the GD Lib? ... contains a compiled dll. ... setup.py script for Linux systems. ...
    (comp.lang.python)
  • Re: Has anyone actually built emacs 21.3 for SOLARIS (sparc)?
    ... Then why do you not install that library if you wish to use it? ... You certainly have the option in the ./configure script to choose motif ... I run Solaris 9, not Solris. ...
    (comp.unix.solaris)
  • Re: OpenBSD 4.2 upgrade to 4.3 breaks kde and konqueror
    ... I removed all the kde modules and tried to reinstall kde with ... Script started on Fri May 30 16:34:00 2008 ... Can't install kdelibs-3.5.8p3: lib not found xml2.9.7 ...
    (comp.windows.x.kde)
  • Re: function definition syntax
    ... :> In which case it might as well be a separate script - you don't need a function. ... :>: That's much more reliable than having to remember which syntax ... Always using POSIX ... :> not overlook restoring IFS. ...
    (comp.unix.shell)