Listing all Perl modules in @INC

A commonly asked question by sysadmins is how to list all perl modules – installed and known to perl – on a system.

This is how i do it:

perl -MFile::Find=find -MFile::Spec::Functions -Tlwe 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC;'

* I took this somewhere from perlmonks a long time ago.


Leave a Reply

Your email address will not be published / Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.