Home / Alt manpages / perlglossary(1)

  • perlglossary(1)
  • User command
  • linux

Read Perl Terms Quickly with perlglossary

You will use the installed perlglossary reference to look up Perl vocabulary from a shell, search its definitions, and move between the terminal man page and the Perl documentation file. Allow about ten minutes. You need a Linux shell and the perl-doc package; no elevated privileges are needed.

This is a reference document, not a program that performs a conversion or changes a Perl installation. That distinction prevents the most common mistake: trying to pass a term to perlglossary as though it were an executable.

1. Confirm the installed documentation

Check the Perl and package versions first. Version details matter because the local page and the current upstream page can describe different glossary revisions:

$ perl -v | sed -n '1,3p'
This is perl 5, version 38, subversion 2 (v5.38.2) built for x86_64-linux-gnu-thread-multi
(with 67 registered patches, see perl -V for more detail)

$ dpkg-query -W -f='${Package} ${Version}\n' perl-doc
perl-doc 5.38.2-3.2ubuntu0.6

On this machine the man page reports perlglossary version 5.20210520, while the installed Perl runtime is 5.38.2. The page version is the useful identifier for the glossary text itself. A later Perl package may contain newer definitions.

Checkpoint: confirm that the manual is discoverable before looking for a definition:

$ command -v man
/usr/bin/man
$ man -f perlglossary
perlglossary (1)     - Perl Glossary

2. Open the glossary in the terminal

Open the complete reference with section 1 specified explicitly:

$ man 1 perlglossary

The terminal viewer normally opens at the beginning. Type /array context and press Enter to search, then use n for the next match. Press q to leave the viewer. The glossary is arranged alphabetically from A to Z, so searching is quicker than paging through it when you already know the term.

Definitions in the page use cross-references such as list context or hash. A bold term means that the glossary defines it elsewhere. Search that exact term when the first definition assumes vocabulary you do not yet know.

3. Extract a definition for a quick check

When you need a small, script-friendly excerpt rather than an interactive viewer, render the page without terminal formatting and search the result:

$ man perlglossary | col -b | grep -A 8 -m 1 '^       array context$'
       array context
           An archaic expression for what is more correctly referred to as
           list context.

col -b removes backspace-based formatting that a man page can use for bold text. The exact spacing and wrapping can vary with the installed formatter and terminal width, so treat this as a way to find a passage, not a stable data format. The exit status is also useful in a script: grep returns failure when the term is absent.

For a case-insensitive search across the rendered page, use grep -i:

$ man perlglossary | col -b | grep -i -m 5 'taint'
       taint checks
       tainted
       taint mode

This lists matching lines, not necessarily complete definitions. Use the interactive page when context matters.

4. Use perldoc when the man viewer is unavailable

Perl also ships the glossary as a POD documentation file. perldoc can display it using Perl's documentation path:

$ perldoc perlglossary | sed -n '1,8p'
NAME
    perlglossary - Perl Glossary

VERSION
    version 5.20210520

DESCRIPTION
    A glossary of terms (technical and otherwise) used in the Perl

Find the source file without opening it with perldoc -l:

$ perldoc -l perlglossary
/usr/share/perl/5.38/pod/perlglossary.pod

The file path is package-specific. Do not hard-code it in a script when perldoc perlglossary is enough. If perldoc cannot find the page, check that perl-doc is installed and that you are invoking the perldoc belonging to the Perl installation you intend to use.

5. Avoid treating the glossary as a language reference

Use perlglossary to clarify terminology, not to settle every question about syntax, module interfaces or security behaviour. For an operator or function, look up the dedicated Perl manual page instead. For example, a glossary entry can explain what a scalar is, but it is not a substitute for the documentation of a particular function's context rules.

Do not infer that a term's presence means it is recommended in new code. Glossaries preserve historical vocabulary as well as current concepts. The local page also includes entries that point to older Perl terminology, such as associative array pointing to hash.

No command in this workflow writes files, changes Perl configuration or needs sudo. If you redirected output to a file while experimenting, remove only that deliberately named temporary file after checking it. The man page and POD source remain unchanged.

Done means

  • man -f perlglossary finds the Perl Glossary on the host.
  • man 1 perlglossary opens the complete alphabetised reference.
  • You can search interactively with /term and n, or extract rendered text with col -b.
  • perldoc perlglossary provides a second local view, and perldoc -l reveals its installed source path.
  • You know the local glossary revision and have kept terminology lookup separate from changes to Perl or the operating system.