Skip to content

Instantly share code, notes, and snippets.

@michaelrice
Created May 5, 2015 17:50
Show Gist options
  • Select an option

  • Save michaelrice/6a74a3ac79b239329bf3 to your computer and use it in GitHub Desktop.

Select an option

Save michaelrice/6a74a3ac79b239329bf3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use warnings;
use strict;
my $file = "VimStub.java";
my @method_names = ();
open FILE, $file or die $!;
while(<FILE>) {
if( $_ =~ /public \w+\b (.*)\(/g) {
#print $1."\n";
if( grep { $1 eq $_} @method_names) {
print "$1 duplicate found\n";
}
else {
push @method_names, $1;
}
}
}
print "found ";
print scalar @method_names;
print " methods in total\n";
close($file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment