Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Perl module: local::lib
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Perl module: local::lib
Perl module: local::lib
07-09-2008 9:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Too late for the current platform, but I wonder if Plusnet could include this (or similar) in a future platform. It basically simplifies the process of creating a local non-root perl library and means that users can install modules into their own space using the CPAN shell.
It probably does other things too but that's what I'm aware of. Without having local::lib available globally you need a bit of messing around to "bootstrap" it into perl before perl programs can make use of it. Once its in it sets four environment variables so perl knows where to find modules.
It probably does other things too but that's what I'm aware of. Without having local::lib available globally you need a bit of messing around to "bootstrap" it into perl before perl programs can make use of it. Once its in it sets four environment variables so perl knows where to find modules.
Message 1 of 5
(1,409 Views)
4 REPLIES 4
Re: Perl module: local::lib
07-09-2008 11:52 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hello there OliverB,
I am not sure if this will work, but I hope this does...
You might be able to use Shell Script to get around this one,
I am not sure if it's technically permitted as I've thought this off the top of my head.
1. LD_LIBRARY_PATH (Requires ALL Libraries needed to be in an accessible directory)
2. LD_PRELOAD - if it's only one module you can get away with
As for getting that to work with all Perl Scripts ...
I'm not sure at the moment,
I would have thought that index file type & module loading directives in .htaccess would have been the answer.
Hope that helps.
Jim,
I am not sure if this will work, but I hope this does...
You might be able to use Shell Script to get around this one,
I am not sure if it's technically permitted as I've thought this off the top of my head.
1. LD_LIBRARY_PATH (Requires ALL Libraries needed to be in an accessible directory)
#!/bin/sh
# Set default Library Path and Start Perl
export LD_LIBRARY_PATH='~/cgi-bin/libs'
perl $*
2. LD_PRELOAD - if it's only one module you can get away with
#!/bin/sh
# Set preload to library and Start Perl
export LD_PRELOAD='~/cgi-bin/libs/library.so.x'
perl $*
As for getting that to work with all Perl Scripts ...
I'm not sure at the moment,
I would have thought that index file type & module loading directives in .htaccess would have been the answer.
Hope that helps.
Jim,
Message 2 of 5
(452 Views)
Re: Perl module: local::lib
08-09-2008 6:34 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Not sure I get that? Is LD_LIBRARY_PATH the base where Perl gets all its modules?
local::lib sets
MODULEBUILDRC
PERL_MM_OPT
PERL5LIB
PATH
I think PERL5LIB takes priority over the original perl library, but the original path is still in @INC so it falls back correctly.
I get conflicting information on .htaccess but I get the impression it can be used to set environment variables prior to the script loading.
Otherwise I was thinking about forcing local::lib to load using a "use" or "require" command, or maybe a directive in the #! line of the file?
Anyway here's the link to local::lib http://search.cpan.org/~mstrout/local-lib-1.002000/lib/local/lib.pm
and the instructions I was trying to follow:http://www.catalystframework.org/calendar/2007/8
The bit about CPAN doesn't quite work on its own, you need to at least create the folder .cpan and subfolder CPAN and possibly a MyConfig.pm http://sial.org/howto/perl/life-with-cpan/non-root/ after which the lib::local install procedure seems to detect and configure cpan
On another forum someone actually advocated building your own perl binary but I think that's overkill.
local::lib sets
MODULEBUILDRC
PERL_MM_OPT
PERL5LIB
PATH
I think PERL5LIB takes priority over the original perl library, but the original path is still in @INC so it falls back correctly.
I get conflicting information on .htaccess but I get the impression it can be used to set environment variables prior to the script loading.
Otherwise I was thinking about forcing local::lib to load using a "use" or "require" command, or maybe a directive in the #! line of the file?
Anyway here's the link to local::lib http://search.cpan.org/~mstrout/local-lib-1.002000/lib/local/lib.pm
and the instructions I was trying to follow:http://www.catalystframework.org/calendar/2007/8
The bit about CPAN doesn't quite work on its own, you need to at least create the folder .cpan and subfolder CPAN and possibly a MyConfig.pm http://sial.org/howto/perl/life-with-cpan/non-root/ after which the lib::local install procedure seems to detect and configure cpan
On another forum someone actually advocated building your own perl binary but I think that's overkill.
Message 3 of 5
(452 Views)
Re: Perl module: local::lib
09-09-2008 5:13 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Hello again,
LD_LIBRARY_PATH is an Environment Variable,
which can be used to over-ride where an application looks for Modules when it's executed.
That's the idea of the Script.
The down sides are that:
You then need all the libraries that Perl depends upon (for the version running on the Server).
You need a directory which you can put other libraries in WITH the standard libraries and your extended libraries that you require.
(This takes up your web space, as you don't have permissions for write access to /lib or /usr/lib etc, else it'd be easy).
It also means you need to make something or tell Apache,
to run the script rather than go strait off to Perl without making it load your required libraries.
Hope that explains it a bit better.
Jim,
LD_LIBRARY_PATH is an Environment Variable,
which can be used to over-ride where an application looks for Modules when it's executed.
That's the idea of the Script.
The down sides are that:
You then need all the libraries that Perl depends upon (for the version running on the Server).
You need a directory which you can put other libraries in WITH the standard libraries and your extended libraries that you require.
(This takes up your web space, as you don't have permissions for write access to /lib or /usr/lib etc, else it'd be easy).
It also means you need to make something or tell Apache,
to run the script rather than go strait off to Perl without making it load your required libraries.
Hope that explains it a bit better.
Jim,
Message 4 of 5
(452 Views)
Re: Perl module: local::lib
10-09-2008 8:53 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Thanks, though I've read if you use PERL5LIB instead then it searches both locations, your own area and the original lib so you get the best of both worlds. The PERL5LIB location is searched first so it can be used to upgrade modules.
I've still got to figure out forcing the environment variable with .htaccess though, can I just use "setenv"?
.htaccess doesn't SEEM to work?
Otherwise do I need a pretend RewriteRule using the E flag?
I've still got to figure out forcing the environment variable with .htaccess though, can I just use "setenv"?
.htaccess doesn't SEEM to work?
Otherwise do I need a pretend RewriteRule using the E flag?
Message 5 of 5
(452 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- Perl module: local::lib