{"id":28,"date":"2006-12-06T19:49:04","date_gmt":"2006-12-07T02:49:04","guid":{"rendered":"http:\/\/www.dreness.com\/blog\/archives\/28"},"modified":"2019-12-07T17:10:12","modified_gmt":"2019-12-08T00:10:12","slug":"installing-perl-modules-locally","status":"publish","type":"post","link":"https:\/\/dreness.com\/blog\/archives\/28","title":{"rendered":"Installing perl modules locally"},"content":{"rendered":"<p>Dealing with CPAN has always felt a little weird. Today I found a nice shortcut for getting perl modules installed in a home directory, which is really useful for when you don&#8217;t have admin on the box, or if you simply prefer to keep your custom perl stuff all cinched up in a tidy homedir for ease of administration (or if you have to use custom modules on a machine with no dev tools; you can build them on a dev box and then just scp the entire ~\/perl directory to where it&#8217;s needed).<\/p>\n<p><a href=\"https:\/\/metacpan.org\/pod\/release\/STBEY\/LocalModInstall-1.0\/LocalModInstall.pl\">LocalModInstall<\/a> is a script that generates a modified Makefile for a perl module you wish to install, suitable for installing it into your home directory.<\/p>\n<pre>\r\n{42} andre@werk [work\/perl-ldap-0.33] % perl ~\/bin\/LocalModInstall.pl\r\n\/usr\/bin\/perl Makefile.PL PREFIX=\/Users\/andre\/perl \\\r\nINSTALLMAN1DIR=\/Users\/andre\/perl\/usr\/share\/man\/man1 \\\r\nINSTALLMAN3DIR=\/Users\/andre\/perl\/usr\/share\/man\/man3\r\n*** ExtUtils::AutoInstall version 0.59\r\n*** Checking for dependencies...\r\n[Core Features]\r\n- Convert::ASN1   ...loaded. (0.19 >= 0.07)\r\n[SASL authentication]\r\n- Authen::SASL    ...loaded. (2.09 >= 2)\r\n- Digest::MD5     ...loaded. (2.33)\r\n[LDAP URLs]\r\n- URI::ldap       ...loaded. (1.11 >= 1.1)\r\n[LDAPS]\r\n- IO::Socket::SSL ...missing. (would need 0.81)\r\n==> Auto-install the 1 optional module(s) from CPAN? [n] n\r\n[Read\/Write DSML files]\r\n- XML::SAX::Base  ...loaded. (1.04)\r\n[Read\/Write LDIF files]\r\n- MIME::Base64    ...loaded. (3.05)\r\n*** ExtUtils::AutoInstall configuration finished.\r\nWriting Makefile for Net::LDAP\r\n\r\nDon't forget to\r\n\r\n  use lib\r\n  qw(\r\n      \/Users\/andre\/perl\/System\/Library\/Perl\/5.8.6\/darwin-thread-multi-2level\r\n      \/Users\/andre\/perl\/System\/Library\/Perl\/5.8.6\r\n      \/Users\/andre\/perl\/Library\/Perl\/5.8.6\/darwin-thread-multi-2level\r\n      \/Users\/andre\/perl\/Library\/Perl\/5.8.6\r\n  );\r\n\r\nin your scripts (prior to any other \"use\" statements) or to set\r\n\r\n  PERL5LIB=\"\/Users\/andre\/perl\/System\/Library\/Perl\/5.8.6\/darwin-thread-multi-2level\"\r\n  PERL5LIB=\"$PERL5LIB:\/Users\/andre\/perl\/System\/Library\/Perl\/5.8.6\"\r\n  PERL5LIB=\"$PERL5LIB:\/Users\/andre\/perl\/Library\/Perl\/5.8.6\/darwin-thread-multi-2level\"\r\n  PERL5LIB=\"$PERL5LIB:\/Users\/andre\/perl\/Library\/Perl\/5.8.6\"\r\n  export PERL5LIB\r\n\r\nin your shell (or shell configuration file) and to set\r\n\r\n  MANPATH=\"$MANPATH:\/Users\/andre\/perl\/usr\/share\/man\/man1\"\r\n  MANPATH=\"$MANPATH:\/Users\/andre\/perl\/usr\/share\/man\/man3\"\r\n  export MANPATH\r\n\r\nin your shell (or shell configuration file).<\/pre>\n<p>You would then &#8216;make&#8217; and &#8216;make install&#8217; like normal.<\/p>\n<p>However, the &#8216;use lib&#8217; suggestion that is supplied does not work in Mac OS X. The goods seem to be installed in ~\/perl\/lib\/perl5\/site_perl, which is not included in the suggested paths. Instead, I use:<\/p>\n<pre>use lib  qw(\r\n\/path\/to\/home\/perl\/lib\/perl5\/site_perl );<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Dealing with CPAN has always felt a little weird. Today I found a nice shortcut for getting perl modules installed in a home directory, which is really useful for when you don&#8217;t have admin on the box, or if you &hellip; <a href=\"https:\/\/dreness.com\/blog\/archives\/28\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4,3,6],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-development","category-os-x","category-os-x-server","category-scripts"],"_links":{"self":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":1,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"predecessor-version":[{"id":980,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/posts\/28\/revisions\/980"}],"wp:attachment":[{"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dreness.com\/blog\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}