This is a vague request that search couldn't help with. I am sure you will be able.

I want to create a 'here' document/program that will determine ALL of the missing packages from a set of specified packages in 1 run. Not the first only, per run. This is a pre-test in an installation script.

Simple. I will assume that if the named package is present, the dependencies are also loaded.

--Solution--

The replies I received were just what I was hopeing for. 4 very different approaches.

For my usual projects, I try to support the largest number of OS default installations. That means that I avoid using non-Core packages. Two of the solutions provided involve non-core packages, which will not be present in a default install, or possibly in one where additional packages requested were not installed.

That leaves two remaining solutions. The first involved a loop arround an 'eval', which is pretty much what I expected. The second was a nesting of 'map' 'grep' 'map' eval require. Both solution worked (on a core only Perl install) and supplied approximately the same information.

Using the HOP principal of being wary of 'extreme cleverness' (for future maintenance reasons), I choose the classic "looped eval require" solution

Thank you all, I will be digging into the one liner for my own edification.

It is always better to have seen your target for yourself, rather than depend upon someone else's description.


In reply to checking for all packages by Wiggins

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.