{"id":184,"date":"2004-09-14T18:49:00","date_gmt":"2004-09-14T18:49:00","guid":{"rendered":"http:\/\/jclark.org\/weblog\/Programming\/Perl\/moduletips.html"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-30T04:00:00","slug":"moduletips","status":"publish","type":"post","link":"https:\/\/jclark.org\/weblog\/2004\/09\/14\/moduletips\/","title":{"rendered":"Perl Module Tips"},"content":{"rendered":"<p>This a bit of pre-emptive blogging, for the next time I forget.  Those of you with stronger Perl-fu than I already know these things.<\/p>\n<h5>How to check if a module is installed:<\/h5>\n<p>No output indicates success :\nperl -MMODULENAME -e1<\/p>\n<p>For example:\nperl -MHTML::Embperl -e1<\/p>\n<h5>How to check the version number of an installed module:<\/h5>\n<p>Assumes the module uses $VERSION, but then, most CPAN modules do) :\nperl -MMODULENAME -e&#8217;print &#8220;$MODULENAME::VERSION\\n&#8221;;&#8217;<\/p>\n<p>For example:\nperl -MHTML::Embperl -e&#8217;print &#8220;$HTML::Embperl::VERSION\\n&#8221;;&#8217;<\/p>\n<h5>How to determine where a module is installed:<\/h5>\n<p>Lists every dir used by the module, including man pages, etc.  Should be entered on one line. :<\/p>\n<pre><code>perl -MExtUtils::Installed \n  -e&#039;$,=&quot;\\n&quot;;print ExtUtils::Installed-&gt;new()-&gt;directories(&quot;MODULENAME&quot;),&quot; &quot;&#039;<\/code><\/pre>\n<p>For example:<\/p>\n<pre><code>perl -MExtUtils::Installed\n  -e&#039;$,=&quot;\\n&quot;;print ExtUtils::Installed-&gt;new()-&gt;directories(&quot;HTML::Embperl&quot;),&quot; &quot;&#039;<\/code><\/pre>\n<p>This technique relies on ExtUtils::Installed, which is part of the standard Perl distro these days.                  <\/p>","protected":false},"excerpt":{"rendered":"<p>This a bit of pre-emptive blogging, for the next time I forget. Those of you with stronger Perl-fu than I already know these things. How to check if a module is installed: No output indicates success : perl -MMODULENAME -e1 For example: perl -MHTML::Embperl -e1 How to check the version number of an installed module: [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-perl"],"_links":{"self":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":0,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"wp:attachment":[{"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jclark.org\/weblog\/wp-json\/wp\/v2\/tags?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}