Created
August 23, 2013 03:32
-
-
Save briandfoy/6315275 to your computer and use it in GitHub Desktop.
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
#!perl | |
use v5.14; | |
use strict; | |
use Module::Extract::Namespaces; | |
LINE: while( <> ) { | |
chomp; | |
my @namespaces = Module::Extract::Namespaces->from_file($_); | |
if( @namespaces == 1 ) { | |
my $file = $namespaces[0] =~ s/::/\//g; | |
$file .= '.pm'; | |
next LINE if /\Q$file\E\Z/; | |
} | |
my $said = 0; | |
my %Seen; | |
foreach my $n ( @namespaces ) { | |
my $file = $n =~ s/::/\//rg; | |
$file .= '.pm'; | |
next if /\Q$file\E\Z/; | |
next if $Seen{$n}++; | |
say unless $said++; | |
print "\t$n\n"; | |
} | |
print "\n" if $said; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment