日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

perl模块的安装,查询

發布時間:2025/4/16 编程问答 34 豆豆
生活随笔 收集整理的這篇文章主要介紹了 perl模块的安装,查询 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
perl模塊的安裝,查詢

linux下cpan安裝:# perl -MCPAN -e shell ? ? ? ? ? ? // 一路回車配置cpan,個別地方需要輸入cpan> install 模塊名
以后安裝就可以:
# perl -MCPAN -e 'install 模塊名'
windows下ActivePerl安裝:直接用Perl Packge Manager圖形安裝就可以了

查詢安裝好的模塊:當你需要使用模個模塊,不知道是不是安裝了的時候,可以使用下面的命令查看:# perldoc perllocal有類似下面的東西出來:PERLLOCAL(1) User Contributed Perl Documentation PERLLOCAL(1)

Thu Feb 18 11:24:54 2010: "Module" Digest::HMAC

· "installed into: /usr/lib/perl5/site_perl/5.8.8"

· "LINKTYPE: dynamic"

· "VERSION: 1.02"

· "EXE_FILES: "

Thu Feb 18 11:24:58 2010: "Module" Net::IP

· "installed into: /usr/lib/perl5/site_perl/5.8.8"

· "LINKTYPE: dynamic"

· "VERSION: 1.25"

· "EXE_FILES: ipcount iptab"

Thu Feb 18 11:29:05 2010: "Module" Config::IniFiles

· "installed into: /usr/lib/perl5/site_perl/5.8.8"

· "LINKTYPE: dynamic"

· "VERSION: 2.56"

· "EXE_FILES: "



另外還可以使用下面的命令:# perl -MConfig::IniFiles -e 1如果不報錯就是已經安裝了.
shell下直接輸入下面命令,可以找到所有已經安裝的模塊.路徑# find `perl -e 'print "@INC"'` -name '*.pm' -print


或者用這個腳本: ?很詳細.http://cpansearch.perl.org/src/MLFISHER/pmtools-1.01/pminst#!/usr/bin/env perl
# pminst -- find modules whose names match this pattern
# tchrist@perl.com

BEGIN { $^W = 1 }

use Getopt::Std qw(getopts);
use File::Find;

getopts('ls') || die "bad usage";

if (@ARGV == 0) {
????????@ARGV = ('.');
}????

die "usage: $0 [-l] [-s] pattern\n" unless @ARGV == 1;

$pattern = shift();
$pattern =~ s,::,/,g;

no lib '.';

use vars qw($opt_l $opt_s);

for $startdir (@INC) {????
????????find(\&wanted, $startdir);
}

sub wanted {
????????if (-d && /^[a-z]/) {????
??# this is so we don't go down site_perl etc too early
??$File::Find::prune = 1;
??return;
????????}
????????return unless /\.pm$/;
????????local $_ = $File::Find::name;
????????($tmpname = $_) =~ s{^\Q$startdir/}{};
????????return unless $tmpname =~ /$pattern/o;

????????if ($opt_l) {????
??s{^(\Q$startdir\E)/}{$1 } if $opt_s;
????????}????
????????else {
??s{^\Q$startdir/}{};????
??s/\.pm$//;
??s{/}{::}g;
??print "$startdir " if $opt_s;
????????}????

????????print $_, "\n";
}????

__END__

=head1 NAME

pminst - find modules whose names match this pattern

=head1 SYNOPSIS

pminst [B<-s>] [B<-l>] [I<pattern>]

=head1 DESCRIPTION

Without argumnets, show the names of all installed modules.????Given a
pattern, show all module names that match it.????The B<-l> flag will show
the full pathname.????The B<-s> flag will separate the base directory from
@INC from the module portion itself.


=head1 EXAMPLES

????????$ pminst
????????(lists all installed modules)

????????$ pminst Carp
????????CGI::Carp
????????Carp

????????$ pminst ^IO::
????????IO::Socket::INET
????????IO::Socket::UNIX
????????IO::Select
????????IO::Socket
????????IO::Poll
????????IO::Handle
????????IO::Pipe
????????IO::Seekable
????????IO::Dir
????????IO::File

????????$ pminst '(?i)io'
????????IO::Socket::INET
????????IO::Socket::UNIX
????????IO::Select
????????IO::Socket
????????IO::Poll
????????IO::Handle
????????IO::Pipe
????????IO::Seekable
????????IO::Dir
????????IO::File
????????IO
????????Pod::Functions

????The -s flag provides output with the directory separated
????by a space:

????????$ pminst -s | sort +1
????????(lists all modules, sorted by name, but with where they????
???????? came from)

????????$ oldperl -S pminst -s IO
????????/usr/lib/perl5/i386-linux/5.00404 IO::File
????????/usr/lib/perl5/i386-linux/5.00404 IO::Handle
????????/usr/lib/perl5/i386-linux/5.00404 IO::Pipe
????????/usr/lib/perl5/i386-linux/5.00404 IO::Seekable
????????/usr/lib/perl5/i386-linux/5.00404 IO::Select
????????/usr/lib/perl5/i386-linux/5.00404 IO::Socket
????????/usr/lib/perl5/i386-linux/5.00404 IO
????????/usr/lib/perl5/site_perl LWP::IO
????????/usr/lib/perl5/site_perl LWP::TkIO
????????/usr/lib/perl5/site_perl Tk::HTML::IO
????????/usr/lib/perl5/site_perl Tk::IO
????????/usr/lib/perl5/site_perl IO::Stringy
????????/usr/lib/perl5/site_perl IO::Wrap
????????/usr/lib/perl5/site_perl IO::ScalarArray
????????/usr/lib/perl5/site_perl IO::Scalar
????????/usr/lib/perl5/site_perl IO::Lines
????????/usr/lib/perl5/site_perl IO::WrapTie
????????/usr/lib/perl5/site_perl IO::AtomicFile

????The -l flag gives full paths:

????????$ filsperl -S pminst -l Thread
????????/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Queue.pm
????????/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Semaphore.pm
????????/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Signal.pm
????????/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Specific.pm
????????/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread.pm

=head1 AUTHOR and COPYRIGHT

Copyright (c) 1999 Tom Christiansen

This is free software.????You may modify it and distribute it????
under Perl's Artistic Licence.????Modified versions must be
clearly indicated.


最后一個腳本,是查找你安裝的所有第三方模塊及其版本號:#!/usr/bin/perl????
use strict;
use ExtUtils::Installed;

my $inst= ExtUtils::Installed->new();????
my @modules = $inst->modules();????

foreach(@modules)
{
????????????????my $ver = $inst->version($_) || "???";????
????????????????printf("%-12s --????%s\n", $_, $ver);
}
exit 0;




windows下還是那個東西,圖形的.

轉載于:https://blog.51cto.com/jasonyong/276885

總結

以上是生活随笔為你收集整理的perl模块的安装,查询的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。