Hello,

I would like to show a message for users to install the needed perl modules when my script starts and dependencies are missing.

I would like to show users the command to install modules from the OS distribution packages first, if they are available there, and show a `cpanm` install command for modules that are not provided in OS repositories.

However, installing OS distribution packages is different for every operating system. On Ubuntu Linux for example I need to invoke `dpkg-query --list` to see if a package like libModule-Name-perl is available in the repos.

This can get complicated when I need to install one module from CPAN, but some of the dependencies are available as OS packages, in which case I should install those first.

So is there a module that can help me install a package from OS distro if available, or from CPAN otherwise ?

Also, do I understand correctly that it is recommended to prefer the CPAN modules instead of the OS ones ? I find this to be a real problem for any non-pure perl module, I belive the OS distro should be preferred in this case.


In reply to How to install module from OS distro if available, and from CPAN otherwise ? by toughy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.