Created
June 8, 2012 17:21
-
-
Save degtyarev-dm/2896998 to your computer and use it in GitHub Desktop.
Reinstall all perl XS-modules, for example after upgrade perl version(App::cpanminus need).
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 strict; | |
use File::Find; | |
my @modules=(); | |
my %hash=(); | |
find(\&wanted,@INC); | |
sub wanted | |
{ | |
push @modules, $1 if ($File::Find::name =~ /.*?auto\/([A-Z]([\w\d_\/]+)?)\/[\w\d_]+\.so$/); | |
} | |
my @uniq=grep{!$hash{$_}++} @modules; | |
for my $module (sort @uniq) | |
{ | |
$module =~s/\//\:\:/g; | |
system("cpanm --reinstall ".$module); | |
} | |
print "[finish]"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment