﻿<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://purl.org/atom/ns#">
	<link xmlns="http://purl.org/atom/ns#" type="text/html" rel="alternate" href="http://sial.org/blog/" title="Jeremy Mates’s Blog"/>
	<title xmlns="http://purl.org/atom/ns#">Jeremy Mates’s Blog</title>
	<entry xmlns="http://purl.org/atom/ns#" xmlns:default="http://www.w3.org/1999/xhtml">
		<title xmlns="http://purl.org/atom/ns#">Non-root Perl Module Installation</title>
		<dc:subject>Perl</dc:subject>
		<summary xmlns="http://purl.org/atom/ns#">summary</summary>
		<content xmlns="http://purl.org/atom/ns#" mode="escaped">&lt;p&gt;Updated &lt;a href="/howto/perl/life-with-cpan/non-root/"&gt;Using CPAN with a non-root account&lt;/a&gt; to include better details on testing a custom &lt;tt&gt;PERL5LIB&lt;/tt&gt;, among other improvements. On a related note, ZSH functions to show the version of or path to a named Perl module:&lt;/p&gt;
&lt;p class="sial-block-code"&gt;function pm-version {
  perl -M$1 -le "print \$$1::VERSION"
}

function pm-path {
  perl -M$1 -le "print \$INC{\"${1//::/\/}.pm\"}"
}&lt;/p&gt;
&lt;p&gt;Some modules, however, may not set a &lt;tt&gt;$VERSION&lt;/tt&gt; scalar, and instead might offer a &lt;tt&gt;version&lt;/tt&gt; method, or something else entirely. Regardless of this complication, the functions offer a quick mechanism to check the version, path to the module, and means to inspect the code:&lt;/p&gt;
&lt;p class="sial-block-shell"&gt;$ &lt;kbd&gt;pm-version Bundle::LWP&lt;/kbd&gt;
5.810
$ &lt;kbd&gt;pm-path !$&lt;/kbd&gt;
pm-path Bundle::LWP
/home/jmates/lib/perl5/Bundle/LWP.pm
$ &lt;kbd&gt;less `!!`&lt;/kbd&gt;
…&lt;/p&gt;


&lt;!-- technorati tags start --&gt;&lt;p style="text-align:right;font-size:10px;"&gt;Technorati Tags: &lt;a href="http://www.technorati.com/tag/Perl" rel="tag"&gt;Perl&lt;/a&gt;, &lt;a href="http://www.technorati.com/tag/Unix" rel="tag"&gt;Unix&lt;/a&gt;&lt;/p&gt;&lt;!-- technorati tags end --&gt;
&lt;br /&gt;

		</content>
		<issued xmlns="http://purl.org/atom/ns#">2009-03-02T01:31:40-0800</issued>
		<link xmlns="http://purl.org/atom/ns#" type="text/html" rel="alternate" href="http://sial.org/blog/2009/03/nonroot_perl_module_installati.html" title=""/>
		<id xmlns="http://purl.org/atom/ns#">337</id>
	</entry>
</feed>
