Skip to content

Instantly share code, notes, and snippets.

@Cside
Created January 3, 2011 23:54
Show Gist options
  • Save Cside/764200 to your computer and use it in GitHub Desktop.
Save Cside/764200 to your computer and use it in GitHub Desktop.
ack 'use 'の出力ファイルから仕様モジュールの名前を抜き出す
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