Skip to content

Instantly share code, notes, and snippets.

@getkub
Created February 15, 2018 16:04
Show Gist options
  • Save getkub/5e04ab597d9ea4316473b7788f410008 to your computer and use it in GitHub Desktop.
Save getkub/5e04ab597d9ea4316473b7788f410008 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
# list all of the perl modules installed
use File::Find ;
for (@INC) { find(\&modules,$_) ; }
sub modules
{
if (-d && /^[a-z]/) { $File::Find::prune = 1 ; return }
return unless /\.pm$/ ;
my $fullPath = "$File::Find::dir/$_";
$fullPath =~ s!\.pm$!!;
$fullPath =~ s#/(\w+)$#::$1# ;
print "$fullPath \n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment