How to know if perl module is installed and its version

Run in your command line:

perldoc -l LWP::UserAgent

/usr/local/share/perl5/LWP/UserAgent.pm

perl -e 'foreach (@INC) { print `find $_ -type f -name "*.pm"`; }' |grep UserAgent

/usr/local/share/perl5/LWP/UserAgent.pm
/usr/share/perl5/CPAN/LWP/UserAgent.pm
./.cpanm/work/1589816008.10374/CPAN-2.27/blib/lib/CPAN/LWP/UserAgent.pm
./.cpanm/work/1589816008.10374/CPAN-2.27/lib/CPAN/LWP/UserAgent.pm

cpan -i LWP::UserAgent

Reading ‘/home/.cpan/Metadata’
Database was generated on Fri, 10 Apr 2020 20:29:02 GMT
CPAN: Module::CoreList loaded ok (v2.76_02)
LWP::UserAgent is up to date (6.46).

perldoc -m LWP::UserAgent |grep VERSION

our $VERSION = ‘6.46’;
$parser->utf8_mode(1) if $] >= 5.008 && $HTML::Parser::VERSION >= 3.40;
sub _agent { “libwww-perl/$VERSION” }

Source: https://stackoverflow.com/questions/1039107/how-can-i-check-if-a-perl-module-is-installed-on-my-system-from-the-command-line

https://www.perl.com/article/1/2013/3/24/3-quick-ways-to-find-out-the-version-number-of-an-installed-Perl-module-from-the-terminal/

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *