Created
April 16, 2013 16:10
-
-
Save kevindawson/5397248 to your computer and use it in GitHub Desktop.
perl version -> plv.pl
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 v5.14; | |
use strict; | |
use warnings; | |
our $VERSION = '0.03'; | |
use English qw( -no_match_vars ); # Avoids regex performance penalty | |
local $OUTPUT_AUTOFLUSH = 1; | |
use CPAN; | |
printf("%-40s %10s %10s\n", "Module", "Installed", "CPAN"); | |
foreach my $a (@ARGV) { | |
foreach my $mod (CPAN::Shell->expand("Module", $a)){ | |
printf("%-40s %10s %10s %s\n", | |
$mod->id, | |
$mod->inst_version eq "undef" || !defined($mod->inst_version) | |
? "-" : $mod->inst_version, | |
$mod->cpan_version eq "undef" || !defined($mod->cpan_version) | |
? "-" : $mod->cpan_version, | |
$mod->uptodate ? "" : "*" | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment