Perl模块利用CPAN在线安装自动化
需要解决2个问题:
1、 如何与CPAN交互:利用perl –MCPAN –e ‘install 模块’
2、 如何安装指定的版本:作者/模块-版本.tar.gz
|
How to install a specific version of a Perl module with CPAN Mar 27, 2013 by David Farrell Perl modules are usually installed via CPAN on the command line. This is invoked with the following syntax: cpan My::Module CPAN will always try to install the latest stable version of a module, which is a sensible default, however this may not always be the required behaviour. To have CPAN install a specific version of a module, you need to provide the full module distribution filename including the author. For example to install the module Set::Object version 1.28, at the command line type: cpan SAMV/Set-Object-1.28.tar.gz You can find the distribution filename for a module by searching for the module on CPAN. |

完整例子:
|
#!/bin/sh perl -MCPAN -e 'install "TIMB/DBI-1.639.tar.gz"' #安装DBI1.639版本 version=`perl -MDBI -e 'print DBI->VERSION'` #检查版本 if [ "$version" == "1.639" ]; then echo "install ok" else echo "install fail" fi |
Perl模块利用CPAN在线安装自动化的更多相关文章
- perl 简单学习,安装perl模块
检查是否安装了某个perl模块 有多种方式 0.perldoc perlinstall 列出所有的模块及版本号 1. perl -M模块名 -e 1(模块名不加空格) 没有返回值则说明有此模块 2.p ...
- perl模块终极解决方案--转载
不管别人怎么说,反正我是非常喜欢perl语言的! 也会继续学习,以前写过不少perl模块的博客,发现有点乱,正好最近看到了关于local::lib这个模块. 居然是用来解决没有root权限的用户安装, ...
- Linux CPAN Perl 模块安装
当我们想使用某些Perl模块的时候,很可能会遇到当前系统不存在这个模块的情况,这时我们可以通过使用CPAN来对相应的模块进行获取,下面就介绍一下CPAN的使用方法.首先,我们可以用perl -e 'u ...
- Linux下安装与使用本地的perl模块
转自 http://www.cnblogs.com/xianghang123/archive/2012/08/23/2652806.html Linux下安装与使用本地的perl模块 在使用Linux ...
- linux安装perl模块
查询perl CPAN模块 shell>perl -MCPAN -e shell cpan>install module_name 手动安装perl CPAN模块 从 CPAN(h ...
- perl模块安装
转自: http://www.cnblogs.com/itech/archive/2009/08/10/1542832.html http://www.mike.org.cn/blog/index.p ...
- Linux上安装Perl模块的两种方法
Linux/Unix下安装Perl模块有两种方法:手工安装和自动安装.第一种方法是从CPAN上下载 您需要的模块,手工编译.安装.第二种方法是联上internet,使用一个叫做CPAN的模块自动完 ...
- 非[无]root权限 服务器 下安装perl以及perl模块--转载
转载自http://www.zilhua.com 在本博客中,所有的软件安装都在服务器上,且无root权限.理论上适合所有的用户. 我的安装目录 cd /home/zilhua/software 1. ...
- 非[无]root权限 服务器 下安装perl以及perl模块
转载自http://www.zilhua.com 在本博客中,所有的软件安装都在服务器上,且无root权限.理论上适合所有的用户. 我的安装目录 cd /home/zilhua/software 1. ...
随机推荐
- spark集群体系结构
- python 3.x 学习笔记9 (面向对象)
1.面向对象 面向对象是一种对现实世界理解和抽象的方法,是计算机编程技术发展到一定阶段后的产物. 2.类(class): 一个类即是对一类拥有相同属性的对象的抽象.蓝图.原型.在类中定义了这些对象的都 ...
- ZBrush实用插件ZAppLink简介
ZAppLink是ZBrush版本推出时被评为最值得期待的插件.事实证明,ZAppLink的出现让工具与工具之间有了交流,搭起软件与软件的沟通桥梁. ZAppLink插件专用于扩展ZBrush®的绘制 ...
- 1044 - Access denied for user 'root'@'%' to database 'xahy-blog' 解决方案二
检查 user 表中'root'@'%' 的grant的权限 select HOST,USER,Grant_priv,Super_priv from mysql.`user`; 可以看到现在这两个权限 ...
- pyinstall 常见错误
字符编码错误: https://blog.csdn.net/weixin_42426496/article/details/81102665 https://blog.csdn.net/qq_4206 ...
- git 源码安装后报错/usr/bin/git: No such file or directory
现象 今天源码安装一个git后,执行git命令后报如下错误: $ git --version -bash: /usr/bin/git: No such file or directory 分析过程 开 ...
- linux常用命令技巧
原文地址 这篇文章来源于Quroa的一个问答<What are some time-saving tips that every Linux user should know?>—— Li ...
- ZOJ 1825 Compound Words
Compound Words Time Limit: 5000ms Memory Limit: 32768KB This problem will be judged on ZJU. Original ...
- Qt之QNetworkProxy(网络代理)
简述 QNetworkProxy类提供了一个网络层代理. QNetworkProxy提供了配置网络层代理支持Qt网络类的方法.目前支持的类有QAbstractSocket.QTcpSocket.QUd ...
- 集合框架(List和Set)
一.概述 集合是一种可变数据项的容器,具有统一的父类接口Collection<E>(Map并没有继承之),与其子集合的关系例如以下 图.集合的特点是长度可变,能够存储多种类型的对象(不加泛 ...