Sponsored Content
Top Forums Programming How to automatically install all modules required by a script from CPAN? Post 302732443 by Tribe on Saturday 17th of November 2012 05:38:26 PM
Old 11-17-2012
How to automatically install all modules required by a script from CPAN?

Having a script.pl how can I automatically download from CPAN all required modules and install and update as required? Something like "emerge -uDNav world" for the perl?

---------- Post updated at 05:38 PM ---------- Previous update was at 05:28 PM ----------

Doesn't matter I've found it

Code:
cat *.pl  | grep "^use " | tr ';' ' ' | while read a b c; do echo $b; done | sort -iu | while read a; do cpan $a; done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

CYGWIN/CPAN install of Expect.pm

I am attempting to install a Perl Expect module via the CPAN . CPAN goes through the process but nothing happens, sample perl scripts can not find the Expect Module. CPAN was configured via the Default process " Are you ready for manual configuration? " answered "no". CPAN install seemed to find... (1 Reply)
Discussion started by: white222
1 Replies

2. HP-UX

Modules Required For SCSI Tape?

I've got an HP9000 server and I'm trying to hook up a tape drive to it. When I go into "SAM-->Peripheral Devices-->Tape Drives", the tape isn't listed. I then choose to "ADD" a drive, and I get the following error. I know I need to install the "stape" module, but for some reason even that... (2 Replies)
Discussion started by: quantumdude
2 Replies

3. Shell Programming and Scripting

CPAN: using only wget to d/l modules?

Is there a way to tell CPAN not to use Net::Ftp and the ftp binary? I want to only use wget to download perl modules. (2 Replies)
Discussion started by: dangral
2 Replies

4. Shell Programming and Scripting

How to install perl modules

Hi. i installed perl 5.8.8.822 in my D: drive(windows xp).When im trying to install IO-Stringy.pm module( or any module for tat matter ) it is getting installed in 'c:\temp\please run installed script' folder no matter from where ever i run the ppm installation.The path variable is set to... (3 Replies)
Discussion started by: Anuj8584
3 Replies

5. Shell Programming and Scripting

[Perl] How to install with CPAN specified version of module

Hello all, i am searching how to install a module but the question is : howto specify CPAN to install a determined version of the module ? In my case i want to install DBD:Oracle1.14 and not version 1.23 proposed ! Any idea welcome ! :rolleyes: Thanks ! (1 Reply)
Discussion started by: sun_cracker
1 Replies

6. Shell Programming and Scripting

Error while trying to install from CPAN

Hi i was trying to install Text::CSV from cpan... it seemed to have downloaded everythign properly but was not able to run the make file... do u have any idea as to why this happened?? Install: ============================= If you install Text::CSV_XS v.0.70, it makes Text::CSV faster. ... (5 Replies)
Discussion started by: VGR
5 Replies

7. OS X (Apple)

Unable to install Perl module via CPAN

Hi, I am trying to install Unicode::String from the cpan shell, and here is what I get: Checking if your kit is complete... Looks good Writing Makefile for Unicode::String cp String.pm blib/lib/Unicode/String.pm cp lib/Unicode/CharName.pm blib/lib/Unicode/CharName.pm... (3 Replies)
Discussion started by: psychomachine
3 Replies

8. Shell Programming and Scripting

Unable to install module using cpan

Hi, I am unable to install module using cpan. It says 407 Proxy Authentication Required I did setup proxy server and given username and password in .bashrc file and apt.conf file. export http_proxy=http://username:password@proxyserver:portno/ However, still unable to install... (1 Reply)
Discussion started by: Anjan1
1 Replies

9. Shell Programming and Scripting

Script to install Perl Modules

Hi guys, I need to upgrade perl modules on about multiple machines. I'm writing a for loop for it. for i in 1 2 3 4 5 6; do ssh server$i " sudo cpan Mozilla::CA, sudo cpan LWP::UserAgent, sudo cpan LWP::Protocol::https, sudo cpan IO::Socket::SSL, sudo cpan Net::SSL,... (2 Replies)
Discussion started by: scj2012
2 Replies

10. UNIX for Dummies Questions & Answers

How to install CPAN without using yum on Linux?

Hi all, I am on Linux box where CPAN is not working for downloading any perl modules. When I try "perl -MCPAN -e shell" as root as well as a user, I get following error: Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl... (2 Replies)
Discussion started by: pat_pramod
2 Replies
CPANPLUS::Selfupdate(3) 				User Contributed Perl Documentation				   CPANPLUS::Selfupdate(3)

NAME
CPANPLUS::Selfupdate - self-updating for CPANPLUS SYNOPSIS
$su = $cb->selfupdate_object; @feats = $su->list_features; @feats = $su->list_enabled_features; @mods = map { $su->modules_for_feature( $_ ) } @feats; @mods = $su->list_core_dependencies; @mods = $su->list_core_modules; for ( @mods ) { print $_->name " should be version " . $_->version_required; print "Installed version is not uptodate!" unless $_->is_installed_version_sufficient; } $ok = $su->selfupdate( update => 'all', latest => 0 ); METHODS
$self = CPANPLUS::Selfupdate->new( $backend_object ); Sets up a new selfupdate object. Called automatically when a new backend object is created. @cat = $self->list_categories Returns a list of categories that the "selfupdate" method accepts. See "selfupdate" for details. %list = $self->list_modules_to_update( update => "core|dependencies|enabled_features|features|all", [latest => BOOL] ) List which modules "selfupdate" would upgrade. You can update either the core (CPANPLUS itself), the core dependencies, all features you have currently turned on, or all features available, or everything. The "latest" option determines whether it should update to the latest version on CPAN, or if the minimal required version for CPANPLUS is good enough. Returns a hash of feature names and lists of module objects to be upgraded based on the category you provided. For example: %list = $self->list_modules_to_update( update => 'core' ); Would return: ( core => [ $module_object_for_cpanplus ] ); $bool = $self->selfupdate( update => "core|dependencies|enabled_features|features|all", [latest => BOOL, force => BOOL] ) Selfupdate CPANPLUS. You can update either the core (CPANPLUS itself), the core dependencies, all features you have currently turned on, or all features available, or everything. The "latest" option determines whether it should update to the latest version on CPAN, or if the minimal required version for CPANPLUS is good enough. Returns true on success, false on error. @features = $self->list_features Returns a list of features that are supported by CPANPLUS. @features = $self->list_enabled_features Returns a list of features that are enabled in your current CPANPLUS installation. @mods = $self->modules_for_feature( FEATURE [,AS_HASH] ) Returns a list of "CPANPLUS::Selfupdate::Module" objects which represent the modules required to support this feature. For a list of features, call the "list_features" method. If the "AS_HASH" argument is provided, no module objects are returned, but a hashref where the keys are names of the modules, and values are their minimum versions. @mods = $self->list_core_dependencies( [AS_HASH] ) Returns a list of "CPANPLUS::Selfupdate::Module" objects which represent the modules that comprise the core dependencies of CPANPLUS. If the "AS_HASH" argument is provided, no module objects are returned, but a hashref where the keys are names of the modules, and values are their minimum versions. @mods = $self->list_core_modules( [AS_HASH] ) Returns a list of "CPANPLUS::Selfupdate::Module" objects which represent the modules that comprise the core of CPANPLUS. If the "AS_HASH" argument is provided, no module objects are returned, but a hashref where the keys are names of the modules, and values are their minimum versions. CPANPLUS
::Selfupdate::Module "CPANPLUS::Selfupdate::Module" extends "CPANPLUS::Module" objects by providing accessors to aid in selfupdating CPANPLUS. These objects are returned by all methods of "CPANPLUS::Selfupdate" that return module objects. $version = $mod->version_required Returns the version of this module required for CPANPLUS. $bool = $mod->is_installed_version_sufficient Returns true if the installed version of this module is sufficient for CPANPLUS, or false if it is not. BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>. AUTHOR
This module by Jos Boumans <kane@cpan.org>. COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved. This library is free software; you may redistribute and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-05-20 CPANPLUS::Selfupdate(3)
All times are GMT -4. The time now is 01:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy