Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Installing binary-dependant module on shared hosting (Time::Piece)

by isync (Hermit)
on Apr 17, 2007 at 20:32 UTC ( [id://610637]=perlquestion: print w/replies, xml ) Need Help??

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

I am on managed hosting and have no rights to install additional perl modules via cpan.

As a workaround, I just uploaded the extracted module archives to the script's directory. But now I seem to have reached the end of this solution.

I uploaded the contents of Time::Piece:
-Piece.pm
-Piece.xs
-Seconds.pm
to a /Time subdirectory.

Running the script, which needs Time::Piece, I got this error:

"Can't locate loadable object for module Time::Piece in @INC".

I think it is because Piece.xs needs to be compiled. But how do I do this? Possible? Or is there another problem?
  • Comment on Installing binary-dependant module on shared hosting (Time::Piece)

Replies are listed 'Best First'.
Re: Installing binary-dependant module on shared hosting (Time::Piece)
by Joost (Canon) on Apr 17, 2007 at 20:48 UTC
      I did as described and still no success.

      After I wrangled with unix permissions and the output of the compiler on my local machine, I uploaded the blib path which contains

      /arch
      /lib
      /man3

      directories. Then, an error later, as I thought the module coulnd't find it, I moved a copy of the "Piece.so" file from /arch into the /lib tree and got the following error:

      "Can't load '/path/to/blib/lib//auto/Time/Piece/Piece.so' for module Time::Piece: /path/to/blib/lib//auto/Time/Piece/Piece.so: cannot open shared object file: No such file or directory at /usr/lib/perl/5.6.1/DynaLoader.pm line 202. "

      I use "use lib qw( /path/to/blib/lib/ );" in the script.
        You should use use lib '/path/to/blib' not use '/path/to/blib/lib' if i understand you correctly.

        So the argument to "use lib" should be the directory containing both "lib" and "arch".

        update: or maybe you should move the whole "arch" directory into the "lib" dir. I'm not sure.

        update 2: after inspecting the code in blib I assume what you actually need to do is:

        use lib "/path/to/blib/lib"; use lib "/path/to/blib/arch";
Re: Installing binary-dependant module on shared hosting (Time::Piece)
by dana (Monk) on Apr 17, 2007 at 21:06 UTC

    You can specify the installation directory by following the directions at the bottom of the following:
    http://www.bugzilla.org/docs/2.22/html/nonroot.html

    Then specify which lib to use at the top of your perl script:
    use lib qw( /this/is/the/path/to/my/installed/module/ )

      Does this comment imply I should stop manualy extracting module tars into my script dirs and instead modify the cpan workings to use a dir in my directory domain (and finally solve the permission problem)?
        The CPAN config allows you to establish your own lib in your home file space (or anyplace you can write to). After which you can simply "use lib("path_to_your_cpan_libs") at the top of your perl code. So yes, that is the route that I go when I can't install to the system lib location for Perl. Another method with detail is described here ->

        The easiest way to get what you want is to

        $>perl -MCPAN -e sh

        then

        cpan> o conf init

        Details here->

        hope that helps....

        ...the majority is always wrong, and always the last to know about it...

        Exactly.

        You can use CPAN, writing to a directory of your choice to which you have access, then reference that directory in a 'use lib' statement.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://610637]
Approved by Old_Gray_Bear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2024-04-25 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found