in reply to checking for all packages

Hi,

This is what I understand, that your are doing some installation and have a set of package list with you, and want to check those packages already installed or not?

If any of those package is not already installed you need that package name as well as its dependency packages also. Correct me if I am wrong.

Show us what is your progress so for on this? so that we can help you better.


All is well

Replies are listed 'Best First'.
Re^2: checking for all packages
by Wiggins (Hermit) on May 16, 2014 at 19:02 UTC
    Quickly this morning I simply wrote out a file to temp with all of the non-core Perl modules that will be used.
    use Net::IP; use Net::CIDR; use List::BinarySearch;
    then
    $rc = `perl -c /tmp/perltest.pl`;
    But this will fail on the 1st missing module and not check the next 2. I am hoping there is a 'pattern' or typical usage with 'eval', a 'foreach' and a list of module names.
    Plagiarism is the highest form if flattery.

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

      Given an array of module names, you can use UNIVERSAL::require to check for their presence:
      require UNIVERSAL::require; my @modules_to_check = qw(Net::IP Net::CIDR List::BinarySearch); for my $module (@modules_to_check) { $module->require or warn "$module failed to load\n"; }

      Hi,

      Instead of using those modules with use, you can try with perldoc command (check perldoc already installed) You can check for a module's installation path by: perldoc -l ourmodule::name

      Have it list of packages in array, use foreach loop and execute perldoc command and check. perldoc -l will return the only the file name of the module found.

      Getting the CPAN dependency tree of a Perl module

      All is well