Difference between revisions of "Perl"

From Ever changing code
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Package manager =
= Package manager =
;cpanm: from App::cpanminus is a script to get, unpack, build and install modules from CPAN. It's dependency free (can bootstrap itself) and requires zero configuration
;cpan: from CPAN has been distributed with Perl since 1997 (5.004). It has many more options than cpanm, it is also much more verbose.
;cpanp: from CPANPLUS had been distributed with Perl since 5.10 (2007) until 5.20 (2014). This offers even more options than cpanm or cpan and can be installed just like cpanminus.
<source lang="perl">
<source lang="perl">
$ cpan App::cpanminus #initialize package manager
$ sudo apt-get install make  #it's prerequisite
$ cpan local::lib     #enables to install modules without requiring root or administrator access
$ cpan App::cpanminus       #initialize package manager
$ cpanm <Module>::<Name>
& sudo apt install cpanminus #(optional) via apt package manager
$ cpan local::lib           #enables to install modules without requiring root or administrator access
$ cpanm <Module>::<Name>     #use sudo (most cases) if you don't use local libs
</source>
</source>


 
= Common packages =
You can search available packages in [http://www.cpan.org/modules/index.html cpan repository].
You can search available packages in [http://www.cpan.org/modules/index.html cpan repository].
<source lang="perl">
<source lang="perl">
# Install common packages
# Install common packages
cpan Task::Kensho #recommended modules
cpan XML::Smart
cpan XML::Smart
cpan XML::RSS
cpan XML::RSS
Line 15: Line 23:
cpan POSIX
cpan POSIX
</source>
</source>
= Resources =
= Resources =
* [http://www.cpan.org/modules/INSTALL.html How to install CPAN modules]
* [http://www.cpan.org/modules/INSTALL.html How to install CPAN modules]
* [https://metacpan.org/pod/local::lib#The-bootstrapping-technique The bootstrapping technique] allows to install modules without admin privileges
* [https://github.com/m1geo/MediaWiki-to-WordPress MediaWiki-to-WordPress] Git repository

Latest revision as of 00:34, 14 October 2018

Package manager

cpanm
from App::cpanminus is a script to get, unpack, build and install modules from CPAN. It's dependency free (can bootstrap itself) and requires zero configuration
cpan
from CPAN has been distributed with Perl since 1997 (5.004). It has many more options than cpanm, it is also much more verbose.
cpanp
from CPANPLUS had been distributed with Perl since 5.10 (2007) until 5.20 (2014). This offers even more options than cpanm or cpan and can be installed just like cpanminus.


$ sudo apt-get install make  #it's prerequisite
$ cpan App::cpanminus        #initialize package manager
& sudo apt install cpanminus #(optional) via apt package manager
$ cpan local::lib            #enables to install modules without requiring root or administrator access
$ cpanm <Module>::<Name>     #use sudo (most cases) if you don't use local libs

Common packages

You can search available packages in cpan repository.

# Install common packages
cpan Task::Kensho #recommended modules
cpan XML::Smart
cpan XML::RSS
cpan Date::Parse
cpan POSIX

Resources