What is perl modules in linux

How do I install a Perl Module?

Q . How do I install a Perl module under Linux or UNIX like operating system?

A . Perl modules (a Perl module is a discrete component of software for the Perl programming language) can be installed using various methods under different Linux distributions.

Task: Install perl module

If you are using Red Hat Linux then use up2date command to install most common modules:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

# up2date module-name
Use following command to list all supported modules:
# up2date —showall | grep -i ‘perl’
OR use yum command under CentOS/RHEL 5/Fedora core:
# yum list available ‘perl’

If you are using Debian Linux , try to use apt-get command to install common perl module. However following is the recommended way to install a perl module.

A) Start CPAN Shell:
# perl -MCPAN -e shell

B) Install a perl module:
At cpan> shell prompt install module using install module::Name command. For example install module called MIME::Lite:
# cpan> install MIME::Lite
Alternatively, try out the following command:
# cpan -i MIME::Lite

See also:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

Try Perl Module Manager

To Install perl modules and all dependent modules,Uninstall perl modules,List all perl modules in system,Search for a perl module in cpan.org and system,List all files of a perl module and Details of a perl module.

Download it from

It will help you.

can any one help me to istall perl “MIME lite” install and use?

For IIS Windows servers you probably need to have compiler “nmake.exe” 64bit version.
If you are running plesk you will find a copy on C:\plesk \…..\…\.\nmake.exe
copy this file to C:\Windows. If the “nmake.exe” is not there simply use search on drive C:\ and you may be lucky to find it somewhere, as other people suggest download and install MS Visual Studio, the nmake.exe will be there so search for it.

Then you can use CPAN and it will download compile and install MIME lite for you. To do this use command prompt:
perl -MCPAN -e shell [ENTER]
cpan> install MIME::Lite [ENTER]
there will be few dependancies to install as well, for these few questions the default answer is set to “yes” so all you need to do is click [ENTER] few times
and you are done.
cpan> exit [ENTER]
close command prompt window.

Источник

What is perl modules in linux

Perl is a family of high-level, general-purpose, interpreted, dynamic programming languages. The languages in this family include Perl 5 and Raku (formerly Perl 6). The Perl languages borrow features from other programming languages including C, shell script (sh), AWK, and sed. They provide powerful text processing facilities without the arbitrary data-length limits of many contemporary Unix commandline tools, facilitating easy manipulation of text files. Perl 5 gained widespread popularity in the late 1990s as a CGI scripting language, in part due to its then unsurpassed regular expression and string parsing abilities.

Contents

Installation

Perl 5

A Raku compiler is provided by rakudo AUR that targets MoarVM and JVM. This AUR package has moarvm AUR as a dependency.

Commands

Perl 5

The Perl language interpreter:

Perl bug reporting:

Lookup the Perl documentation in POD format:

Send the Perl authors and maintainers a thank you message:

Rakudo «raku» compiler:

Perl 5 examples

Classic «Hello, World!» for calling with $ perl hello-world.pl :

With the executable bit set for calling with $ ./hello-you :

A one liner to print the first 10 Fibonacci numbers:

Package management

The Comprehensive Perl Archive Network (CPAN) is a repository of over 250,000 software modules and accompanying documentation written in the Perl programming language by over 12,000 contributors.

CPAN is also the name of a Perl module, CPAN.pm, which is used to download and install Perl software from the CPAN archive.

pacman and AUR

A number of popular CPAN modules are available as packages in the Arch repositories. There are further modules available in the AUR.

CPAN.pm

The CPAN.pm module is included with Perl. It can be used interactively from the shell or in Perl scripts.

Configuring cpan

Before first use, the module needs to be configured. This is done interactively from the shell with (some output omitted):

Automated configuration will suit most users. Answering yes, the configuration will continue with:

If you want cpan to install modules in your home directory choose local::lib . To install them system-wide choose sudo . Choosing sudo the configuration ends:

Choosing the local::lib option will result in addition modules being installed.

Choosing not to use automated configuration allows the user to set cpan options interactively in the shell. The table below shows some option names with a brief description and default value. More detailed information is displayed for each option during configuration.

Name Description Default
cpan_home CPAN build and cache directory $HOME/.cpan
keep_source_where Download target directory $HOME/.cpan/sources
build_dir Build process directory $HOME/.cpan/build
prefs_dir Customizable modules options directory $HOME/.cpan/prefs
build_cache Cache size for build directory 100MB
cleanup_after_install Remove build directory after successful install No
shell Preferred shell /bin/bash
halt_on_failure Halt on failure No
colorize_output Turn on colored output No
histfile History file location $HOME/.cpan/histfile
histsize History file size 100 lines

The configuration file $HOME/.cpan/CPAN/MyConfig.pm can be edited with your text editor of choice.

Usage examples

To simply install a modules pass them as parameters to cpan (multiple module names are separated by spaces):

The following examples are all in the cpan interactive shell, started with:

Display information on a module:

View module README:

Install a module:

Widget bindings

The following widget toolkit bindings are available:

Or you can just draw asci art to create simple gui/webpage user interface:

To use these with Perl, you may need to install the associated widget kits.

Tips and tricks

Improved module management

cpanminus

cpanminus extends module management and aims to be zero configuration and integrates with local::db .

ucpan

ucpan is a nice, fully automatic updater for CPAN modules (especially installed in local-lib). To install use:

Bundle::CPAN

Installing the Bundle::CPAN distribution will add a lot of nice functionality to CPAN.pm.

Re-run cpan configuration

Create new module

module-starter

Module::Starter helps you create your new module. Install:

This going to create your module tree.

To add dependiences, put module_name => version_or_0 inside $builder -> requires in file Build.PL

To install required dependiences for your project, run inside App-foobar folder:

To skip git folder, add under $builder

Adding scripts can by done like this:

To run this script:

You can change your project version here: lib/App/foobar.pm

To install your module run this command in module root folder:

Источник

🐧 Как установить Perl-модули на Linux

В этом кратком руководстве мы покажем, как установить модули Perl в Linux из репозитория CPAN (Comprehensive Perl Archive Network).

На момент написания данного руководства в CPAN было доступно 185128 модулей Perl.

Многие программы, написанные на языке программирования Perl, зависят от определенных модулей Perl для выполнения конкретной задачи.

Например, на днях я тестировал Sysadmin-util, который предоставляет набор полезных инструментов для системных администраторов Linux / Unix:

Когда я тестировал определенный инструмент под названием multi-ping, я столкнулся со следующей ошибкой:

Установим модули Perl на Linux

Существует множество инструментов для установки и модулей Perl.

Мы собираемся попробовать два инструмента, а именно cpan и cpanm.

Стоит отметить, что для многих модулей на CPAN требуется последняя версия Perl 5.8 или выше.

Убедитесь, что вы установили пакет «make» в свой дистрибутив Linux.

«Make» – важный инструмент для создания Perl-модулей.

Если вы не устанавливаете «make», вы можете столкнуться с ошибкой, подобной приведенной ниже:

Пакет make доступен в репозиториях по умолчанию в большинстве дистрибутивов Linux.

Чтобы установить «make» в Arch Linux и его вариантах, запустите:

На Debian, Ubuntu, Linux Mint:

На Fedora:

На RHEL, CentOS:

На SUSE/openSUSE:

Установим модули Perl, используя cpan

cpan является клиентом командной строки для репозитория CPAN и по умолчанию распространяется со всеми версиями Perl.

Чтобы установить модуль Perl, например Net :: DNS, введите в оболочку cpan команду:

После установки модуля введите «exit», чтобы вернуться в свою оболочку.

Вы также можете напрямую установить модуль из Терминала с помощью команды:

Установим модули Perl, используя Cpanminus

Cpanminus или cpanm – это клиент cpan для получения, распаковки, сборки и установки модулей из репозитория CPAN.

Это автономный скрипт без зависимостей, который требует нулевой настройки.

Многие опытные разработчики Perl предпочитают cpanm нежели cpan.

Cpanminus может быть установлен разными способами.

1. Используя Perl:

Чтобы установить последнюю версию cpanm в вашей системе Linux, просто запустите:

2. Используя менеджер пакетов дистрибутива:

cpanm также доступен в репозиториях по умолчанию нескольких дистрибутивов Linux.

Это стабильная версия, но немного старая.

Чтобы установить cpanminus на Arch Linux и его вариантах, запустите:

На Debian, Ubuntu, Linux Mint:

3. Ручная установка:

Кроме того, вы можете вручную загрузить последний двоичный файл cpanm и поместить его в ваш $PATH, как показано ниже.

Пример вывода:

Установим отсутствующие модули Perl с помощью менеджера пакетов дистрибутива

Многие модули Perl доступны в виде пакетов, поэтому вы можете установить их с помощью диспетчера пакетов вашего дистрибутива.

На Debian, Ubuntu:

Чтобы найти отсутствующий модуль в Arch Linux, запустите:

Список установленных модулей Perl

Чтобы просмотреть список установленных модулей Perl, используйте команду «perldoc»:

Вывод:

Вы увидите следующий вывод:

В командной строке введите «l» для просмотра списка модулей.

Обратите внимание, что две вышеуказанные команды приведут список модулей, установленных с помощью cpan.

Там может быть много модулей, установленных вручную или предварительно установленных с вашим дистрибутивом Linux.

Чтобы найти все установленные модули Perl, запустите:

Удалим модули Perl

Модули Perl могут быть легко удалены с помощью cpanm с помощью команды:

Источник

Читайте также:  Sync для windows phone
Оцените статью