<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: How to install Perl modules on Mac OS X in easy steps !!]]></title>
	<link>https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps?</link>
	<atom:link href="https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps?" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps</guid>
	<pubDate>Thu, 20 Oct 2016 07:26:29 -0500</pubDate>
	<link>https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps</link>
	<title><![CDATA[How to install Perl modules on Mac OS X in easy steps !!]]></title>
	<description><![CDATA[<p>Today at work, I learned how to install Perl modules using&nbsp;<a href="http://en.wikipedia.org/wiki/CPAN">CPAN</a>. It&rsquo;s a lot easier than I thought.</p><p>You see, for the past couple of years, I&rsquo;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&rsquo;t find an &ldquo;idiot&rsquo;s&rdquo; 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&nbsp;<a href="http://fink.sourceforge.net/">Fink</a>, which basically installs modules in a path that isn&rsquo;t included in the Perl @INC variable, meaning you have to manually specify the full path to the modules in every script &mdash; which is not a lot of fun if you&rsquo;re developing on OS X and deploying on Red Hat, for instance.</p><p>Moreover, Fink doesn&rsquo;t seem to make every module available, and it&rsquo;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><h4>1) Make sure you have the Apple Developer Tools (XCode) installed.</h4><p>These are on one of your install discs, or available as a huge but free download from the&nbsp;<a href="https://developer.apple.com/xcode/">Apple Developer Connection</a>&nbsp;[free registration required] or the Mac App Store. I thought I had them, but apparently when we upgraded that computer to Tiger, they went missing.</p><p>If you don&rsquo;t have this stuff installed, your installation will fail with errors about unavailable commands.</p><h4>1.5) Install Command Line Tools (Recent XCode versions only)</h4><p>(Thank you to Tom Marchioro for informing me about this step.)</p><p>Older versions of XCode installed the command line tools (which are required to properly install CPAN modules) by default, but apparently newer ones do not. To check whether you have the command line tools already installed, run the following from the Terminal:</p><p><code>$ which make</code></p><p>This command checks the system for the &ldquo;<code>make</code>&rdquo; tool. If it spits out something like&nbsp;<code>/usr/bin/make</code>&nbsp;you&rsquo;re golden and can skip ahead to Step 2. If you just get a new prompt and no output, you&rsquo;ll need to install the tools:</p><ol>
<li>Launch XCode and bring up the Preferences panel.</li>
<li>Click on the Downloads tab</li>
<li>Click to install the Command Line Tools</li>
</ol><p>If you like, you can run&nbsp;<code>which make</code>&nbsp;again to confirm that everything&rsquo;s installed correctly.</p><h4>2) Configure CPAN.</h4><p><code>$ sudo perl -MCPAN -e shell</code></p><p><code>perl&gt; o conf init</code></p><p>This will prompt you for some settings. You can accept the defaults for almost everything (just hit &ldquo;return&rdquo;). The two things you must fill in are the path to&nbsp;<code>make</code>&nbsp;(which should be&nbsp;<code>/usr/bin/make</code>&nbsp;or the value returned when you run&nbsp;<code>which make</code>&nbsp;from the command line) and your choice of CPAN mirrors (which you actually choose don&rsquo;t really matter, but it won&rsquo;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&nbsp;<code>make</code>&nbsp;being unavailable.</p><h4>3) Upgrade CPAN</h4><p><code>$ sudo perl -MCPAN -e 'install Bundle::CPAN'</code></p><p>Don&rsquo;t forget the&nbsp;<code>sudo</code>, or it&rsquo;ll fail with permissions errors, probably when doing something relatively unimportant like installing&nbsp;<code>man</code>&nbsp;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 &ldquo;yes&rdquo;. I agreed to everything it asked me, and everything turned out fine. YMMV of course. If everything installs properly, it&rsquo;ll give you an &ldquo;OK&rdquo; at the end.</p><h4>4) Install your modules. For each module&hellip;.</h4><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&nbsp;<em>and</em>&nbsp;its dependencies. Nice, eh? Again, don&rsquo;t forget the&nbsp;<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>&nbsp;/&nbsp;<code>HEAD</code>&nbsp;issue), but most have workarounds, and I haven&rsquo;t run into anything that wasn&rsquo;t easily recoverable.</p><p>And that&rsquo;s it!</p><p>Did you find this useful? Is there anything I missed?</p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink='true'>https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps#item-annotation-3357</guid>
	<pubDate>Tue, 08 May 2018 09:43:52 -0500</pubDate>
	<link>https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps#item-annotation-3357</link>
	<title><![CDATA[Comment by Jit]]></title>
	<description><![CDATA[<p>Our Perl script for drawing requires&nbsp;<a href="http://www.cpan.org/modules/by-module/GD/" target="_blank">the GD module</a>(2.41 or later version). Moreover, the GD module requires the following packages.</p>
<p><a href="http://www.boutell.com/gd/" target="_blank">The gd graphics library</a>&nbsp;<br><a href="http://www.libpng.org/pub/png/libpng.html" target="_blank">The PNG graphics library</a><br><a href="http://www.zlib.net/" target="_blank">The zlib compression library</a></p>]]></description>
	<dc:creator>Jit</dc:creator>
</item>
<item>
	<guid isPermaLink='true'>https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps#item-annotation-2680</guid>
	<pubDate>Mon, 24 Oct 2016 12:40:20 -0500</pubDate>
	<link>https://bioinformaticsonline.com/blog/view/29479/how-to-install-perl-modules-on-mac-os-x-in-easy-steps#item-annotation-2680</link>
	<title><![CDATA[Comment by Arup Ghosh]]></title>
	<description><![CDATA[<p>Join SEQforum to share your programming and bioinformatics knowledge.</p>
<p>http://seqforum.com/register.php</p>]]></description>
	<dc:creator>Arup Ghosh</dc:creator>
</item>

</channel>
</rss>