Inspect Perl's Installed Files with instmodsh

Before you rip out a Perl module, instmodsh can show exactly which files it installed and whether any have gone missing. This guide lists the modules it can see, inspects a module's installed files and directories, checks its .packlist for missing files, and optionally builds an archive. The examples use the Debian-packaged Perl 5.38.2 installed on this machine.

Before you start

You need a shell with the perl package installed. No root access is needed for the inspection commands, and the program never changes a module while listing or validating it. Allow about five minutes: the interface is interactive, but each command is short.

Checkpoint: This guide is about examining the Perl installation visible to the current interpreter. It is not a package manager and will not tell you everything dpkg has installed. On Debian, core and vendor modules are managed by dpkg, while instmodsh reads Perl's own installation metadata.

1. Confirm the program and Perl version

Check which executable will run, and record the interpreter version, before investigating a problem. This matters when several Perl installations or library paths are present.

command -v instmodsh
perl -v

On the reference system, the executable is /usr/bin/instmodsh and the interpreter reports Perl 5.38.2. The installed manpage is dated 14 September 2026 and describes instmodsh as a small interface to ExtUtils::Installed.

2. List visible modules

Start the shell with no arguments. At its top level, l lists modules and q exits.

instmodsh

At the cmd? prompt, enter:

l
q

The exact list depends on the interpreter's search paths and packlists. On this installation the output includes:

Installed modules are:
   Perl

Perl is a special name representing the core Perl files. If a module you expect is absent, first check that you started the intended instmodsh and that its Perl search paths are the ones you expect. A similarly named module in another Perl installation is not automatically visible here.

3. Select a module

Use m followed by the module name. This opens a second prompt. The example selects the special core entry shown above.

instmodsh
m Perl

The module prompt is labelled Perl cmd?. Its built-in help lists these operations:

f [all|prog|doc]   - List installed files of a given type
d [all|prog|doc]   - List the directories used by a module
v                  - Validate the .packlist - check for missing files
t <tarfile>        - Create a tar archive of the module
h                  - Display module help
q                  - Quit the module

Use q at this prompt to return to the top-level prompt, then q again to leave the program.

4. Inspect files and directories

List all files for the selected module with f. You can narrow the result to program files or documentation with f prog and f doc.

f prog
f doc
d prog

The program prints a heading such as prog files in Perl are:, followed by one path per line. The directory command prints the directories containing files in that class. With no class, both commands use all.

These classifications come from ExtUtils::Installed: prog means program files, doc means manual or documentation files, and all includes both. A long list is normal, and redirecting output to a file is safe if you want to search it later:

printf 'm Perl
f all
q
q
' | instmodsh > /tmp/instmodsh-perl-files.txt
grep -E '/(bin|lib|man)/' /tmp/instmodsh-perl-files.txt

The temporary report is ordinary data. Remove it once you no longer need it:

rm -- /tmp/instmodsh-perl-files.txt

5. Validate the module's packlist

At the module prompt, v compares the files recorded in the module's .packlist with the files that currently exist. It reports missing paths but does not repair or rewrite the packlist.

instmodsh
m Perl
v
q
q

A clean result on the reference machine is:

Perl has no missing files

If paths are reported, treat that as an investigation result rather than proof Perl is broken. A file may have been deliberately removed, the packlist may belong to an older installation, or the command may be looking at a different Perl than the one that installed the files. Do not recreate or delete files solely from this list; check the owning Debian package and the active interpreter first.

6. Create an archive only when you need one

The t command creates a tar archive from the selected module's installed files. This is the only example here that creates a new file, so choose an explicit temporary destination and check it has enough free space. It does not install or remove a module.

instmodsh
m Perl
t /tmp/perl-installed-files.tar
q
q

The archive path is a placeholder. Replace it with a destination you control, not an existing system archive. Verify it without extracting anything:

tar -tf /tmp/perl-installed-files.tar | sed -n '1,20p'
tar -tf /tmp/perl-installed-files.tar > /dev/null

Safety boundary: Do not extract this archive over / or a live Perl tree. If you only needed a test archive, remove the exact temporary file after inspection:

rm -- /tmp/perl-installed-files.tar

If t says Archive::Tar is unavailable, the script falls back to the system tar command. A failure can leave a partial archive at the requested path, so inspect or remove that exact file before retrying. Do not use rm -rf for cleanup.

Common traps

Done means