Last active
January 6, 2019 21:29
-
-
Save bombsimon/8249853df553b95ecae7603346a1e9bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use ExtUtils::Installed; | |
use warnings; | |
use strict; | |
use feature qw( say ); | |
my $inst = ExtUtils::Installed->new(); | |
foreach my $module ( $inst->modules ) { | |
say sprintf( '%-15s - %s', $inst->version($module), $module ); | |
} | |
=head1 ABOUT | |
This scripts lists installed cpan modules using the ExtUtils modules in the | |
format '<version> - <name>' | |
As a oneliner for convenience: | |
perl -MExtUtils::Installed -E \ | |
'$i=ExtUtils::Installed->new(); say for map { sprintf "%-15s %s", $i->version($_), $_ } $i->modules' | |
=cut |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment