Created
January 27, 2013 23:28
-
-
Save eiro/4651301 to your computer and use it in GitHub Desktop.
remove cpan packlist and content
This file contains hidden or 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: perl p5_ls_packlist.pl Perlude MARC::MIR | xargs rm | |
use Modern::Perl; | |
use File::Find::Rule; | |
use File::Slurp; | |
my $matches = do { | |
s,::,/,g for my @path = @ARGV; | |
my $pattern = sprintf '/(?:%s)/.packlist$', join '|', @path; | |
say "qr{$pattern}"; | |
qr{$pattern}; | |
}; | |
map { say for (map {chomp; $_ } read_file $_), $_ } | |
grep { $_ ~~ $matches } | |
File::Find::Rule | |
-> file | |
-> name('.packlist') | |
-> in(@INC); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment