If you have CPAN and the appropriate permissions, then you could easily use a script to install from the command line. For example, using CGI:
#!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install('CGI');
Now, let's say you want to install all the dependencies. Cool, but the major dependencies are mostly core and/or dual-lived. You can't install or upgrade core dependencies without reinstalling perl, so you'll need to scratch the core modules off your list. The dual-lived modules can be upgraded, so leave them on the list. Add to that list any noncore dependencies that are there, and the script is done.

How do you find the dependencies? An easy way is to use CPAN::FindDependencies. Download it, then run this script to get a record:

#!/usr/bin/perl use strict; use warnings; use CPAN; open STDOUT, '>', '/root/Desktop/CGIdeps'; system("cpandeps CGI"); close STDOUT;
You can also run cpandeps CGI from the command line.

Next, to determine which modules are core, you want to use Module::CoreList. From the command line, do corelist CGI. It'll tell you that it's core.

Is CGI core only or dual-lived? Use App::DualLivedList. From the command line, do dual-lived CGI. It'll tell you if it's dual-lived.

The finished script should look something like this:

#!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install( "FCGI", "Scalar::Util", "File::Spec", "Test::Harness", "Test::More", "CGI");

In reply to Re: How to combine multiple perl modules to make them run from command line by Khen1950fx
in thread How to combine multiple perl modules to make them run from command line by newbie_coder

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.