Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

comment on

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

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

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 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 ....


In reply to installing modules by baxy77bax

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, 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
  • 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.
  • Log In?

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

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (5)
    As of 2019-02-18 07:47 GMT
    Find Nodes?
      Voting Booth?
      I use postfix dereferencing ...

      Results (100 votes). Check out past polls.