Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
hi,

well here is the problem. let say i would like to install some module : A.pm

And this module depends on 10 different modules , and some of those modules depend on several other modules ... you get the picture.

to install everything what i would do is, i would use cpan and run the instalation of module A.pm and cpan would ask me do i want to install all the dependencies and i would say yes. ok. so my question is how would i do this automatically, so when i set my perl program on my machine and start it for the first time, then i would like that my program identifies all required modules and if they do not exist ask the user would he or she would like to install them .

BEGIN { my @modules; eval{"use Data::Dumper;"}; push(@modules,"Data::Dumper") if $@; eval{"use Getopt::Long;"}; push(@modules,"Getopt::Long") if $@; eval{"use Term::ReadLine;"}; push(@modules,"Term::ReadLine") if $@; eval{"use Term::ReadKey;"}; push(@modules,"Term::ReadKey") if $@; eval{"use File::Copy;"}; push(@modules,"File::Copy") if $@; eval{"use File::Path;"}; push(@modules,"File::Path") if $@; eval{"use Cwd;"}; push(@modules,"Cwd") if $@; eval{"use IO::Socket;"}; push(@modules,"IO::Socket") if $@; eval{"use bignum;"}; push(@modules,"IO::Socket") if $@; eval{"use Term::ANSIColor;"}; push(@modules,"Term::ANSIColor") if $@; die "Some modules are missing, please install the following modules + and try again:\n -- " . join("\n -- ",@modules) if @modules; }
when the user says YES then connect to the net and identify all dependencies of all modules and download and install everything.

The reason im avoiding cpan interface is because i received some complaints that cpan is too hard to install and that it asks too many questions that a regular MSOffice user doesn't understand. so what i would like to do is to make a script that would identify all necessary dependencies and the when user says 'yes' to install them locally in some folder from where my program knows to read them. without any knowlage what is happening behind the curtains

use lib "./Lib";
are there any examples, or did anyone already done something in this area so i don't reinvent the circular thing on the car or bike or ....

thnx


In reply to installing modules by baxy77bax

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (7)
    As of 2014-08-20 21:04 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (124 votes), past polls