Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 14 lines (12 sloc) 236 Bytes
#!/usr/bin/perl
$pat = shift || die "I won't search for nothing";
while (<STDIN>) {
chomp;
if(-f $_ && open(IN, $_)) {
@matches = grep(/$pat/, <IN>);
close IN;
for $match (@matches) {
print $_, ": ", $match;
}
}
}