<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Noemi Millman &#124; Triopter &#187; Perl</title>
	<atom:link href="http://triopter.com/archive/category/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://triopter.com</link>
	<description>Hello.  My name is Noemi Millman, and Triopter is my web development agency.  We handcraft beautiful, dynamic websites.</description>
	<lastBuildDate>Fri, 06 Aug 2010 16:32:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Install Perl Modules on Mac OS X in 4 Easy Steps</title>
		<link>http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/</link>
		<comments>http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/#comments</comments>
		<pubDate>Tue, 28 Nov 2006 01:55:23 +0000</pubDate>
		<dc:creator>Noemi Millman</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/</guid>
		<description><![CDATA[Today at work, I learned how to install Perl modules using CPAN.  It&#8217;s a lot easier than I thought.
You see, for the past couple of years, I&#8217;ve been a bit frustrated because OS X does not come with a whole lot of Perl modules pre-installed, and for all I googled, I couldn&#8217;t find an [...]]]></description>
			<content:encoded><![CDATA[<p>Today at work, I learned how to install Perl modules using <a href="http://en.wikipedia.org/wiki/CPAN">CPAN</a>.  It&#8217;s a lot easier than I thought.</p>
<p>You see, for the past couple of years, I&#8217;ve been a bit frustrated because OS X does not come with a whole lot of Perl modules pre-installed, and for all I googled, I couldn&#8217;t find an &#8220;idiot&#8217;s&#8221; guide for moderately-savvy-but-not-expert users like myself to install modules and dependencies on demand.</p>
<p>The only instructions I could find point to <a href="http://fink.sourceforge.net/">Fink</a>, which basically installs modules in a path that isn&#8217;t included in the Perl @INC variable (which I still haven&#8217;t figured out how to update), meaning you have to manually specify the full path to the modules in every script &#8212; which is not a lot of fun if you&#8217;re developing on OS X and deploying on Red Hat, for instance.</p>
<p>Moreover, Fink doesn&#8217;t seem to make every module available, and it&#8217;s not very easy to determine which Fink package you need to install if you need a particular module.</p>
<p>So, with a script that called on several apparently unavailable modules, and a deadline looming, I finally decided to suck it up and figure out how to use CPAN to install them:</p>
<h2>1) Make sure you have the Apple Developer Tools installed.</h2>
<p>These are on one of your install discs, or available as a huge but free download from the <a href="https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/308/wo/gs4ttcj3zNp32oyOpzC1DFH4f3i/0.0">Apple Developer Connection</a> [free registration required].  I thought I had them, but apparently when we upgraded that computer to Tiger, they went missing.</p>
<p>If you don&#8217;t have this stuff installed, your installation will fail with errors about unavailable commands.</p>
<h2>2) Configure CPAN.</h2>
<p><code>$ sudo perl -MCPAN -e shell</code></p>
<p><code>perl> o conf init</code></p>
<p>This will prompt you for some settings.  You can accept the defaults for almost everything (just hit &#8220;return&#8221;).  The two things you must fill in are the path to <code>make</code> (which should be <code>/usr/bin/make</code>) and your choice of CPAN mirrors (which you actually choose don&#8217;t really matter, but it won&#8217;t let you finish until you select at least one).  If you use a proxy or a very restrictive firewall, you may have to configure those settings as well.</p>
<p>If you skip Step 2, you may get errors about <code>make</code> being unavailable.</p>
<h2>3) Upgrade CPAN</h2>
<p><code>$ sudo perl -MCPAN -e 'install Bundle::CPAN'</code></p>
<p>Don&#8217;t forget the <code>sudo</code>, or it&#8217;ll fail with permissions errors, probably when doing something relatively unimportant like installing <code>man</code> files.</p>
<p>This will spend a long time downloading, testing, and compiling various files and dependencies.  Bear with it.  It will prompt you a few times about dependencies.  You probably want to enter &#8220;yes&#8221;.  I agreed to everything it asked me, and everything turned out fine.  YMMV of course.  If everything installs properly, it&#8217;ll give you an &#8220;OK&#8221; at the end.</p>
<h2>4) Install your modules.  For each module&#8230;.</h2>
<p><code>$ sudo perl -MCPAN -e 'install Bundle::Name'</code></p>
<p>or</p>
<p><code>$ sudo perl -MCPAN -e 'install Module::Name'</code></p>
<p>This will install the module <em>and</em> its dependencies.  Nice, eh?  Again, don&#8217;t forget the <code>sudo</code>.</p>
<p>The first time you run this after upgrading CPAN, it may prompt you to configure again (see Step 2).  If you accept its offer to try to configure itself automatically, it may just run through everything without a problem.</p>
<p>There are a couple of potential pitfalls with specific modules (such as the <code>LWP::UserAgent</code> / <code>HEAD</code> issue), but most have workarounds, and I haven&#8217;t run into anything that wasn&#8217;t easily recoverable.</p>
<p>And that&#8217;s it!</p>
<p>Did you find this useful?  Is there anything I missed?</p>
]]></content:encoded>
			<wfw:commentRss>http://triopter.com/archive/how-to-install-perl-modules-on-mac-os-x-in-4-easy-steps/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
