Overview
In this guide, we walk through running instmodsh—Perl’s built-in module inspection utility—on Ubuntu and making sense of what it reports. You will learn how to drive its interactive prompt to enumerate installed modules, trace their file and directory layouts, and verify package integrity in real-world troubleshooting scenarios.
Preparing the Environment and Verifying instmodsh
Before experimenting with instmodsh, refresh the local package index and ensure the perl package is present by running apt-get update -qq && apt-get install -y perl.

Next, check whether the instmodsh binary is available on your system with which instmodsh.
If the command returns nothing, instmodsh does not reside in any directory currently listed in your PATH environment variable.

To inspect the active Perl runtime, pipe perl -v | head -n 5 to display just the opening five lines of version metadata.
The output confirms that Perl v5.38.2, compiled for the x86_64-linux-gnu-thread-multi architecture, is installed on the host.

Viewing Help and Listing Installed Modules in instmodsh
You can automate the interactive instmodsh shell via standard input: printf "?\nq\n" | instmodsh pipes (|) the help request (?) followed immediately by the quit command (q).
This one-liner lets you inspect the available interactive commands and exit cleanly without typing inside the prompt manually.
In this test run, nothing was written to standard output.

Similarly, printf "l\nq\n" | instmodsh feeds the list command (l) and exit command (q) into instmodsh.
On a system with tracked Perl distributions, this prints every registered module name.
Here again, the command produced no output.

Inspecting Module Details and Validating .packlist Integrity
To drill into a specific module non-interactively, printf "m Perl\nh\nf all\nd all\nv\nq\nq\n" | instmodsh selects Perl via m Perl, then sequentially requests module help (h), all associated files (f all), directories (d all), .packlist validation (v), and exits (q).
When module metadata is present, this sequence reveals every tracked file and directory path while checking whether any files listed in .packlist are missing from disk.
During this execution, standard output remained empty.

Cross-Checking .packlist Files and Modules from the Terminal
Because instmodsh relies on ExtUtils::Installed under the hood, you can query the exact same data directly with perl -MExtUtils::Installed -e 'print join("\n", ExtUtils::Installed->new->modules), "\n"'.
Loading the module via -MExtUtils::Installed and executing the inline script with -e prints each discovered module name on its own line.
Since this invocation also returned empty output, ExtUtils::Installed is either finding an empty module registry or failing to locate any tracked installations in this environment.

To verify why no modules appeared, search for the .packlist files that ExtUtils::Installed depends on under /usr/lib and /usr/local/lib using find /usr/lib /usr/local/lib -name ".packlist" 2>/dev/null.
Redirecting stderr with 2>/dev/null suppresses permission or traversal warnings so only matching paths surface.
The absence of any returned paths confirms that no .packlist files are present or readable beneath those library directories.

That wraps up how to run instmodsh on Ubuntu and interpret both populated and empty results when auditing Perl modules.
Hopefully, these checks will come in handy the next time you need to verify a Perl environment or troubleshoot missing module metadata.