Created
January 3, 2011 23:54
-
-
Save Cside/764200 to your computer and use it in GitHub Desktop.
ack 'use 'の出力ファイルから仕様モジュールの名前を抜き出す
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
use Path::Class; | |
use List::MoreUtils qw/uniq/; | |
my $file = file(__FILE__)->dir->file('ack_log.txt'); | |
my @lines = $file->slurp; | |
my $exclude = 'exclude_string'; | |
my @modules = uniq( | |
grep { | |
$_ !~ /$exclude/; | |
} | |
map { | |
$_ =~ /.+use ([A-Z]{1}[\w:]+)/; | |
} @lines | |
); | |
@modules; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment