morgon has asked for the wisdom of the Perl Monks concerning the following question:
I want to implement the following logic:
For installing modules I currently use CPAN->install which has the problem that if I run it with a module I already have it updates it (so I need to check first) and I don't seem to get any indication wether or not the install succeeded, so I am forced to do something like this:
Furthermore some module-installations prompt for input (e.g. "do you want to run extra-tests?" etc) that I would like to supress.eval { require "Some::Module"; }; if($@) { # need to install CPAN->install("Some::Module"); eval { require "Some::Module" }; # check if we have it now if($@) { print "installation failed" } } };
What is the proper way to do this?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Programmatically installing modules
by LanX (Saint) on Dec 23, 2013 at 10:34 UTC | |
by morgon (Priest) on Dec 23, 2013 at 10:38 UTC | |
by LanX (Saint) on Dec 23, 2013 at 10:41 UTC | |
by morgon (Priest) on Dec 23, 2013 at 11:02 UTC | |
by LanX (Saint) on Dec 23, 2013 at 11:09 UTC | |
| |
|
Re: Programmatically installing modules (cpan install build interactivity inactivity_timeout )
by Anonymous Monk on Dec 23, 2013 at 10:41 UTC | |
|
Re: Programmatically installing modules
by Anonymous Monk on Dec 23, 2013 at 14:51 UTC | |
|
Re: Programmatically installing modules
by Khen1950fx (Canon) on Dec 23, 2013 at 16:13 UTC | |
|
Re: Programmatically installing modules
by aitap (Curate) on Dec 27, 2013 at 17:41 UTC |