This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
metaconfig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1348562
)
[UTIL] Scan each file max once
author
H.Merijn Brand - Tux
<h.m.brand@xs4all.nl>
Thu, 21 Apr 2016 11:44:41 +0000
(13:44 +0200)
committer
H.Merijn Brand - Tux
<h.m.brand@xs4all.nl>
Thu, 21 Apr 2016 11:44:41 +0000
(13:44 +0200)
bin/metagrep
patch
|
blob
|
blame
|
history
diff --git
a/bin/metagrep
b/bin/metagrep
index
71dce44
..
277e725
100755
(executable)
--- a/
bin/metagrep
+++ b/
bin/metagrep
@@
-40,6
+40,8
@@
find (sub {
exists $dir{$File::Find::dir} or return;
#print STDERR "$File::Find::dir - $_\n";
+ $seen{$File::Find::name}++ and return;
+
$File::Find::dir =~ m{^(?:$cwd/)?dist-3} and return;
open my $f, "<$_" or die "$File::Find::name: $!\n";
@@
-47,8
+49,8
@@
find (sub {
$fnm =~ s{^$cwd/}{};
for (grep /$pat/, <$f>) {
if ($opt_l) {
-
$seen{$fnm}++ or
print "$fnm\n";
-
next
;
+ print "$fnm\n";
+
return
;
}
print "$fnm:$_";
}