Skip to content

Instantly share code, notes, and snippets.

@bombsimon
Last active January 6, 2019 21:29
Show Gist options
  • Save bombsimon/8249853df553b95ecae7603346a1e9bf to your computer and use it in GitHub Desktop.
Save bombsimon/8249853df553b95ecae7603346a1e9bf to your computer and use it in GitHub Desktop.
#!/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