This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
program_lang:perllib [2023/02/17 12:15] manu |
program_lang:perllib [2024/04/19 11:16] (current) manu [CPAN repository offline] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Perl ===== | + | ====== Perl ====== |
| ===== List Perl libraries locations ===== | ===== List Perl libraries locations ===== | ||
| Line 18: | Line 18: | ||
| # perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' | # perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' | ||
| </cli> | </cli> | ||
| + | |||
| + | <cli prompt='#'> | ||
| + | # perldoc -l DBI | ||
| + | /usr/opt/perl5/lib/site_perl/5.28.1/aix-thread-multi/DBI.pm | ||
| + | </cli> | ||
| + | |||
| + | ===== Perl modules ===== | ||
| + | |||
| + | <cli prompt='#'> | ||
| + | [root@fedora ~]# pmall | ||
| + | Encode (3.19) - character encodings in Perl | ||
| + | Clone (0.46) - recursively copy Perl datatypes | ||
| + | Storable (3.26) - persistence for Perl data structures | ||
| + | Cwd (3.84) - get pathname of current working directory | ||
| + | DBI (1.643) - Database independent interface for Perl | ||
| + | Socket (2.036) - networking constants and support functions | ||
| + | Term::ReadKey (2.38) - A perl module for simple terminal control | ||
| + | Sub::Util (1.63) - A selection of utility subroutines for subs and CODE references | ||
| + | IO::Compress::Brotli (0.004001) - Write Brotli buffers/streams | ||
| + | IO::Uncompress::Brotli (0.004001) - Read Brotli buffers/streams | ||
| + | Digest::SHA (6.04) - Perl extension for SHA-1/224/256/384/512 | ||
| + | ... | ||
| + | </cli> | ||
| + | |||
| + | ==== cpan proxy ==== | ||
| + | |||
| + | <cli prompt='>'> | ||
| + | root@aixtest:/root > /opt/freeware/bin/cpan | ||
| + | o conf init /proxy/ | ||
| + | <ftp_proxy> | ||
| + | Your ftp_proxy? [] w.x.y.z:<port> | ||
| + | |||
| + | <http_proxy> | ||
| + | Your http_proxy? [] w.x.y.z:<port> | ||
| + | http://10.10.10.10:8080/ | ||
| + | |||
| + | <no_proxy> | ||
| + | Your no_proxy? [] w.x.y.z:<port> | ||
| + | |||
| + | Proxy userID ? | ||
| + | |||
| + | Proxy password ? | ||
| + | |||
| + | o conf commit | ||
| + | </cli> | ||
| + | |||
| + | <cli prompt='>'> | ||
| + | root@aixtest:/root > perl –MCPAN –e'install <module_name>' | ||
| + | </cli> | ||
| + | |||
| + | Or | ||
| + | <cli prompt='>'> | ||
| + | root@aixtest:/root > cpan Devel::PPPort | ||
| + | </cli> | ||
| + | |||
| + | ==== CPAN error while install modules ==== | ||
| + | |||
| + | Dependencies between modules can be found in CPAN site | ||
| + | |||
| + | ==== CPAN error ==== | ||
| + | |||
| + | Error downloading with HTTP::Tiny: Not a CODE reference | ||
| + | |||
| + | Set the proxy also | ||
| + | export http_proxy="http://user:pass@proxyserver:8080" | ||
| + | export https_proxy="http://user:pass@proxyserver:8080" | ||
| + | export ftp_proxy="http://user:pass@proxyserver:8080" | ||
| + | |||
| + | |||
| + | |||
| + | https://community.ibm.com/community/user/power/blogs/jan-harris1/2022/03/21/aix-open-source-support-tips | ||
| + | |||
| + | ==== CPAN coredumps on AIX ==== | ||
| + | |||
| + | Answer | ||
| + | |||
| + | AIX does not set maxdata because it causes issues for AIX Perl-based commands. | ||
| + | |||
| + | One of the following solutions can usually resolve the issue: | ||
| + | |||
| + | 1) Use the 64-bit module | ||
| + | |||
| + | 2) export LDR_CNTRL=MAXDATA=0x80000000@DSA | ||
| + | |||
| + | 3) Use a perl.rpm version (which is recommended for reasons that are listed in the AIX Perl Updates and Support for perl.rte technote), then use ldedit to permanently set the maxdata value | ||
| + | |||
| + | # ldedit -b maxdata=0x80000000 "path to perl.rpm Perl binary" | ||
| + | |||
| + | ==== CPAN install modules offline ==== | ||
| + | |||
| + | Download Perl module | ||
| + | |||
| + | Go to CPAN Search website and search for the module that you wish to download. In this example, let us search, download and install XML::Parser Perl module. I have downloaded the XML-Parser-2.36.tar.gz to /home/download | ||
| + | <cli prompt='#'> | ||
| + | # cd /home/download | ||
| + | # gzip -d XML-Parser-2.36.tar.gz | ||
| + | # tar xvf XML-Parser-2.36.tar | ||
| + | # cd XML-Parser-2.36 | ||
| + | </cli> | ||
| + | <cli prompt='#'> | ||
| + | # perl Makefile.PL | ||
| + | Checking if your kit is complete... | ||
| + | Looks good | ||
| + | Writing Makefile for XML::Parser::Expat | ||
| + | Writing Makefile for XML::Parser | ||
| + | # make | ||
| + | # make test | ||
| + | # make install | ||
| + | </cli> | ||
| + | |||
| + | ==== CPAN repository offline ==== | ||
| + | |||
| + | https://www.cpan.org/modules/01modules.index.html | ||