pman Command in Linux



The pman command in Linux displays the documentation manual of a Perl module. Perl modules are reusable packages of Perl code, stored in .pm files, used to organize and share functionality, often available via CPAN.

The pman simplifies viewing the documentation of Perl modules by automatically locating the module, converting its POD (Plain Old Documentation) to readable text, and displaying it in a pager.

Table of Contents

Here is a comprehensive guide to the options available with the pman command −

Installation pman Command

The pman command is a part of pmtools package. To use pman on Linux the pmtools package must be installed. To install it on Ubuntu, Kali Linux, Raspberry Pi OS, Debian and Debian-based distributions, use the command given below −

sudo apt install pmtools

To install pman command on Fedora, use the following command −

sudo dnf install perl-pmtools

To verify the installation, check the binary path of pman using the which command −

which pman
pman Command in Linux1

Syntax of pman Command

The syntax of the Linux pman command is as follows −

pman [module]

In the above syntax, the [module] field is used to specify the module name whose document needs to be displayed.

Examples of pman Command in Linux

The section discusses the usage of the pman command in Linux with examples −

Checking Core Module Documentation

To check the core module documentation, use the pman command with the core module name −

pman File::Find
pman Command in Linux2

The documentation of the File::Find module will be opened as shown in the image above.

Other core modules are listed below −

Categories Modules
File and Directory Handling File::Basename, File::Find, File::Path, File::Spec, File::Temp
Data Structures and Manipulation Data::Dumper, Storable, List::Util, Scalar::Util
Input and Output IO::Handle, IO::File, IO::Socket, Fcntl
Text Processing Text::ParseWords, Text::Wrap, Encode, POSIX
Process Management IPC::Open2, IPC::Open3, Time::HiRes
Networking and Web Net::Ping, Socket, LWP::Simple
Date and Time Time::Piece, Time::Local, Time::HiRes
Regular Expressions re, perlre
Debugging and Testing Test::Simple, Test::More, Carp
System Interaction Cwd, Env, Config
Security Digest::MD5, Digest::SHA, MIME::Base64
Specialized Utilities Getopt::Long, Pod::Usage, DB_File, SDBM_File

Checking Documentation of Locally Installed Modules

To list the installed Perl modules on Linux use the instmodsh command −

instmodsh

After executing press l to list all the installed modules as shown in the following output image −

pman Command in Linux3

Press q to quit.

To view documentation of the JSON Perl modules, use the pman command in the following way −

pman JSON
pman Command in Linux4

Similarly, the documentation of other installed modules can also be viewed.

Searching and Displaying Documentation using perl Command

The -S option with the perl command tells Perl to search for the script in the directories listed in the system's PATH environment variable. This option is useful when running Perl scripts like pman without providing the full path to the script.

perl -S pman File::Temp
pman Command in Linux5

Conclusion

The pman command in Linux is a tool for accessing the documentation of Perl modules, simplifying the process by locating the module, converting its POD format into readable text, and displaying it. It is part of the pmtools package and can be installed using apt for Debian-based systems or dnf for Fedora.

The pman command supports viewing core module documentation, checking locally installed modules, and using Perl with the -S option for searching scripts. This tool helps explore Perl modules categorized by functionalities such as file handling, networking, debugging, and more.

In this tutorial, we covered the pman command, its installation, and its usage in Linux with examples.

Advertisements