{"id":1330,"date":"2011-04-30T11:33:07","date_gmt":"2011-04-30T15:33:07","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1330"},"modified":"2013-03-20T08:43:56","modified_gmt":"2013-03-20T12:43:56","slug":"how-to-install-a-perl-module-in-linux","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-install-a-perl-module-in-linux","title":{"rendered":"How to install a Perl Module in Linux?"},"content":{"rendered":"<p><strong>There are various ways to download and install perl modules from CPAN.<\/strong> In general it&#8217;s a good idea to download and install the perl module but we will see the different ways of installing the perl module.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>Method 1.<\/strong><\/span> The easiest way is to use the perl CPAN module. SSH to the server as root and execute:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># cpan<\/span><\/pre>\n<\/blockquote>\n<p>if you are running this for the first time, it will prompt you for a few questions (default answers are fine) before providing you with the &#8220;cpan &gt;&#8221; prompt. <strong>To install a module, say for example &#8220;Perl::OSType&#8221;<\/strong>, execute<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">cpan &gt; install Perl::OSType<\/span><\/pre>\n<\/blockquote>\n<p>this will download and compile the module and install it server wide. To know more commands\/options of cpan, type question mark ( ? ) at the cpan prompt.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>Method 2.<\/strong><\/span> The second and the quickest method is to use perl CPAN module from the bash prompt instead of &#8216;cpan&#8217; prompt. If you are on the command line of Linux, just execute<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># perl -MCPAN -e 'install Perl::OSType'<\/span><\/pre>\n<\/blockquote>\n<p><span style=\"color: #0000ff;\"><strong>Method 3.<\/strong><\/span> The above 2 methods are the easiest one but it is recommended to install the module manually as the above methods may not always work.<\/p>\n<p>Search and download the module from http:\/\/search.cpan.org\/ and then wget it on your server. Once done, extract it:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># tar -zxf Perl-OSType-1.002.tar.gz<\/span><\/pre>\n<\/blockquote>\n<p>Untar the downloaded file and go to the extracted directory. There is a README file inside the directory with the installation steps, however, here are they:<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># perl Makefile.PL <\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"># make <\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"># make test <\/span><\/pre>\n<pre><span style=\"color: #0000ff;\"># make install<\/span><\/pre>\n<\/blockquote>\n<p>That is it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are various ways to download and install perl modules from CPAN. In general it&#8217;s a good idea to download and install the perl module but we will see the different ways of installing the perl module.<br \/>\nMethod 1. The easiest way is to use the perl CPAN module. SSH to the server as root and execute:<\/p>\n<p># cpan<\/p>\n<p>if you are running this for the first time, it will prompt you for a few questions (default answers are fine) before providing you with the &#8220;cpan &gt;&#8221; prompt. To install a [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[1219,1225,1227,1224,1229,1230,1220],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1330"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1330"}],"version-history":[{"count":12,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1330\/revisions"}],"predecessor-version":[{"id":2257,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1330\/revisions\/2257"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}