-
-
Save bsdf/2772279 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/perl | |
# Usage: upgrade-cpan.pl 5.14.0 | sort -u | cpanm | |
use strict; | |
use File::Find::Rule; | |
use JSON; | |
my $old = shift; | |
my @files = File::Find::Rule->file->name('install.json')->in("$ENV{HOME}/perl5/perlbrew/perls/perl-$old/lib/site_perl/$old"); | |
for my $file (@files) { | |
my $module = parse_json($file)->{name}; | |
print $module, "\n" if $module; | |
} | |
sub parse_json { | |
open my $fh, shift or die $!; | |
JSON::decode_json(join '', <$fh>); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replacing $ENV{HOME} with $ENV{PERLBREW_ROOT} will support perlbrew installs in non-standard locations.